]> git.decadent.org.uk Git - ion3.git/blob - ion/Makefile
Updated for version 20070720-2.
[ion3.git] / ion / Makefile
1 ##
2 ## Ion Makefile
3 ##
4
5 # System-specific configuration is in system.mk
6 TOPDIR=..
7 include $(TOPDIR)/build/system-inc.mk
8
9 # List of modules to possibly preload
10 include $(TOPDIR)/modulelist.mk
11
12 ######################################
13
14 SOURCES=ion.c
15
16 TARGETS=ion3
17
18 INCLUDES += $(X11_INCLUDES) 
19 INCLUDES += $(LIBMAINLOOP_INCLUDES) $(LIBTU_INCLUDES) $(LIBEXTL_INCLUDES)
20 INCLUDES += -I..
21
22 LIBS += $(X11_LIBS)
23 LIBS += $(WHOLEA) $(LIBMAINLOOP_LIBS) $(LIBEXTL_LIBS) $(LIBTU_LIBS) $(NO_WHOLEA)
24 LIBS += $(LUA_LIBS) $(DL_LIBS)
25 LIBS += -lm
26
27 ifeq ($(PRELOAD_MODULES),1)
28 EXT_OBJS += $(foreach mod, $(MODULE_LIST), ../$(mod)/$(mod).a)
29 DEPEND_DEPENDS += preload.c
30 SOURCES += preload.c
31 TO_CLEAN += preload.c
32 LIBS += -lSM -lICE
33 else
34 LINKOPTS = $(EXPORT_DYNAMIC)
35 WHOLEA = -Wl,-whole-archive
36 NO_WHOLEA = -Wl,-no-whole-archive
37 endif
38
39 EXT_OBJS += ../ioncore/ioncore.a
40
41 DEFINES += -DETCDIR=\"$(ETCDIR)\" -DSHAREDIR=\"$(SHAREDIR)\" \
42            -DEXTRABINDIR=\"$(EXTRABINDIR)\" -DMODULEDIR=\"$(MODULEDIR)\" \
43            -DLCDIR=\"$(LCDIR)\" -DLOCALEDIR=\"$(LOCALEDIR)\"
44
45 CFLAGS += $(XOPEN_SOURCE) $(C99_SOURCE)
46
47 ######################################
48
49 include $(TOPDIR)/build/rules.mk
50
51 ######################################
52
53 ion3: $(OBJS) $(EXT_OBJS)
54         $(CC) $(LINKOPTS) $(OBJS) $(WHOLEA) $(EXT_OBJS) $(NO_WHOLEA) $(LDFLAGS) -o $@
55
56 preload.c:
57         $(LUA) ../build/mkpreload.lua $(MODULE_LIST) > preload.c
58
59 _install:
60         $(INSTALLDIR) $(BINDIR)
61         $(INSTALL) -m $(BIN_MODE) ion3 $(BINDIR)