]> git.decadent.org.uk Git - ion3.git/blob - pwm/Makefile
[svn-upgrade] Integrating new upstream version, ion3 (20071130)
[ion3.git] / pwm / Makefile
1 ##
2 ## PWM 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=pwm.c
15
16 ETC = cfg_pwm.lua
17
18 TARGETS = pwm3
19
20 INCLUDES += $(X11_INCLUDES) 
21 INCLUDES += $(LIBMAINLOOP_INCLUDES) $(LIBTU_INCLUDES) $(LIBEXTL_INCLUDES)
22 INCLUDES += -I..
23
24 LIBS += $(X11_LIBS)
25 LIBS += $(WHOLEA) $(LIBMAINLOOP_LIBS) $(LIBEXTL_LIBS) $(LIBTU_LIBS) $(NO_WHOLEA)
26 LIBS += $(LUA_LIBS) $(DL_LIBS)
27 LIBS += -lm
28
29 ifeq ($(PRELOAD_MODULES),1)
30 EXT_OBJS += $(foreach mod, $(PWM_MODULE_LIST), ../$(mod)/$(mod).a)
31 DEPEND_DEPENDS += preload.c
32 SOURCES += preload.c
33 TO_CLEAN += preload.c
34 LIBS += -lSM -lICE
35 else
36 LINKOPTS = $(EXPORT_DYNAMIC)
37 WHOLEA = -Wl,-whole-archive
38 NO_WHOLEA = -Wl,-no-whole-archive
39 endif
40
41 EXT_OBJS += ../ioncore/ioncore.a
42
43 DEFINES += -DETCDIR=\"$(ETCDIR)\" -DSHAREDIR=\"$(SHAREDIR)\" \
44            -DEXTRABINDIR=\"$(EXTRABINDIR)\" -DMODULEDIR=\"$(MODULEDIR)\" \
45            -DLCDIR=\"$(LCDIR)\" -DLOCALEDIR=\"$(LOCALEDIR)\"
46
47 ifndef PWM_ETCDIR
48 PWM_ETCDIR = $(ETCDIR)
49 else
50 DEFINES += -DPWM_ETCDIR=\"$(PWM_ETCDIR)\"
51 endif
52
53 CFLAGS += $(XOPEN_SOURCE) $(C99_SOURCE)
54
55 ######################################
56
57 include $(TOPDIR)/build/rules.mk
58
59 ######################################
60
61 pwm3: $(OBJS) $(EXT_OBJS)
62         $(CC) $(LINKOPTS) $(OBJS) $(WHOLEA) $(EXT_OBJS) $(NO_WHOLEA) $(LDFLAGS) -o $@
63
64 preload.c:
65         $(LUA) ../build/mkpreload.lua $(PWM_MODULE_LIST) > preload.c
66
67 _install:
68         $(INSTALLDIR) $(BINDIR)
69         $(INSTALL) -m $(BIN_MODE) pwm3 $(BINDIR)
70         $(INSTALLDIR) $(PWM_ETCDIR)
71         for i in $(ETC); do \
72                 $(INSTALL) -m $(DATA_MODE) $$i $(PWM_ETCDIR); \
73         done