ide: makefile generation and makefiles: added NOSTRIP option.
[sdk] / ear / extract / Makefile
1 .PHONY: all objdir clean realclean distclean
2
3 # CONTENT
4
5 MODULE := extract
6 CONFIG := release
7 COMPILER := default
8 TARGET_TYPE = executable
9
10 OBJ = obj/$(CONFIG).$(PLATFORM)/
11
12 RES = 
13
14 CONSOLE = -mwindows
15
16 TARGET = obj/$(CONFIG).$(PLATFORM)/extract$(E)
17
18 OBJECTS = \
19         $(OBJ)extract.o \
20         $(OBJ)$(MODULE).main$(O)
21
22 COBJECTS = \
23         $(OBJ)extract.c
24
25 SYMBOLS = \
26         $(OBJ)extract.sym
27
28 IMPORTS = \
29         $(OBJ)extract.imp
30
31 SOURCES = \
32         extract.ec
33
34 RESOURCES = $(RESOURCES1) $(RESOURCES2)
35 RESOURCES1 = \
36         ../../ecere/res/vanilla/ecere/actions/folderNew.png \
37         ../../ecere/res/vanilla/ecere/actions/goUp.png \
38         ../../ecere/res/vanilla/ecere/devices/computer.png \
39         ../../ecere/res/vanilla/ecere/devices/driveHardDisk.png \
40         ../../ecere/res/vanilla/ecere/devices/driveRemovableMedia.png \
41         ../../ecere/res/vanilla/ecere/devices/mediaFloppy.png \
42         ../../ecere/res/vanilla/ecere/devices/mediaOptical.png \
43         ../../ecere/res/vanilla/ecere/elements/areaClose.png \
44         ../../ecere/res/vanilla/ecere/elements/areaMaximize.png \
45         ../../ecere/res/vanilla/ecere/elements/areaMinimize.png \
46         ../../ecere/res/vanilla/ecere/elements/areaRestore.png \
47         ../../ecere/res/vanilla/ecere/elements/arrowDown.png \
48         ../../ecere/res/vanilla/ecere/elements/arrowLeft.png \
49         ../../ecere/res/vanilla/ecere/elements/arrowRight.png \
50         ../../ecere/res/vanilla/ecere/elements/arrowUp.png \
51         ../../ecere/res/vanilla/ecere/elements/optionBoxDisabledSelected.png \
52         ../../ecere/res/vanilla/ecere/elements/optionBoxDown.png \
53         ../../ecere/res/vanilla/ecere/elements/optionBoxSelected.png \
54         ../../ecere/res/vanilla/ecere/elements/optionBoxSelectedDown.png \
55         ../../ecere/res/vanilla/ecere/elements/optionBoxUp.png \
56         ../../ecere/res/vanilla/ecere/places/driveRemote.png \
57         ../../ecere/res/vanilla/ecere/places/folder.png \
58         ../../ecere/res/vanilla/ecere/places/folderRemote.png \
59         ../../ecere/res/vanilla/ecere/places/networkServer.png \
60         ../../ecere/res/vanilla/ecere/places/networkWorkgroup.png \
61         ../../ecere/res/vanilla/ecere/status/folderOpen.png \
62         locale/zh_CN/LC_MESSAGES/extract.mo
63 RESOURCES2 = \
64         locale/es_ES/LC_MESSAGES/extract.mo
65
66 # CROSS-PLATFORM MAGIC
67
68 include ../../include.mk
69
70 # TOOLCHAIN
71 export LD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
72 export DYLD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
73 ECP := $(call psep,../../compiler/bootstrap/obj/bin.$(PLATFORM)/ecp)
74 ECC := $(call psep,../../compiler/bootstrap/obj/bin.$(PLATFORM)/ecc)
75 ECS := $(call psep,../../compiler/bootstrap/obj/bin.$(PLATFORM)/ecs)
76 EAR := $(call psep,../../obj/$(PLATFORM)/bin/ear)
77
78 # FLAGS
79
80 CFLAGS = -fmessage-length=0 -Os -m32 $(FPIC) -w \
81          -DECERE_STATIC
82
83 CECFLAGS =
84
85 ECFLAGS = -nolinenumbers
86
87 OFLAGS = -m32 \
88          -L../../ecere/obj/vanilla.$(PLATFORM) \
89          -L../../deps/zlib/obj/release.$(PLATFORM)
90
91 LIBS = -lecereVanilla -lz $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
92
93 UPXFLAGS = -9 -q --no-progress --no-color
94
95 # HARD CODED PLATFORM-SPECIFIC OPTIONS
96 ifdef LINUX
97 OFLAGS += -Wl,--no-undefined
98 endif
99
100 # PLATFORM-SPECIFIC OPTIONS
101
102 ifdef WINDOWS
103
104 LIBS += -lmpr -lwinmm -limm32
105
106 else
107 ifdef LINUX
108
109 OFLAGS += \
110          -L/usr/X11R6/lib
111
112 LIBS += -lfontconfig -lfreetype -lXrender -lXext -lncurses -lm -ldl -lpthread -lX11
113
114 else
115 ifdef OSX
116
117 OFLAGS += \
118          -L/usr/X11R6/lib
119
120 LIBS += -lfontconfig -lfreetype -lXrender -lXext -lncurses -lm -ldl -lpthread -lX11
121
122 endif
123 endif
124 endif
125
126 # TARGETS
127
128 all: objdir $(TARGET)
129
130 objdir:
131         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
132
133 $(OBJ)$(MODULE).main.ec: $(SYMBOLS) $(COBJECTS)
134         $(ECS) $(ECSLIBOPT) $(SYMBOLS) $(IMPORTS) -symbols obj/$(CONFIG).$(PLATFORM) -o $(OBJ)$(MODULE).main.ec
135
136 $(OBJ)$(MODULE).main.c: $(OBJ)$(MODULE).main.ec
137         $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.sym -symbols $(OBJ)
138         $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.c -symbols $(OBJ)
139
140 $(SYMBOLS): | objdir
141 $(OBJECTS): | objdir
142 $(TARGET): $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
143         $(CC) $(OFLAGS) $(OBJECTS) $(LIBS) -o $(TARGET) $(INSTALLNAME)
144 ifndef NOSTRIP
145         $(STRIP) $(STRIPOPT) $(TARGET)
146 endif
147 ifndef WINDOWS
148 ifeq "$(TARGET_TYPE)" "executable"
149         @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
150 endif
151 else
152         @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
153 endif
154         $(EAR) awq $(TARGET) ../../ecere/res/vanilla/ecere/actions/folderNew.png ../../ecere/res/vanilla/ecere/actions/goUp.png "ecere/actions"
155         $(EAR) awq $(TARGET) ../../ecere/res/vanilla/ecere/devices/computer.png ../../ecere/res/vanilla/ecere/devices/driveHardDisk.png ../../ecere/res/vanilla/ecere/devices/driveRemovableMedia.png ../../ecere/res/vanilla/ecere/devices/mediaFloppy.png ../../ecere/res/vanilla/ecere/devices/mediaOptical.png "ecere/devices"
156         $(EAR) awq $(TARGET) ../../ecere/res/vanilla/ecere/elements/areaClose.png ../../ecere/res/vanilla/ecere/elements/areaMaximize.png ../../ecere/res/vanilla/ecere/elements/areaMinimize.png ../../ecere/res/vanilla/ecere/elements/areaRestore.png ../../ecere/res/vanilla/ecere/elements/arrowDown.png ../../ecere/res/vanilla/ecere/elements/arrowLeft.png ../../ecere/res/vanilla/ecere/elements/arrowRight.png ../../ecere/res/vanilla/ecere/elements/arrowUp.png ../../ecere/res/vanilla/ecere/elements/optionBoxDisabledSelected.png ../../ecere/res/vanilla/ecere/elements/optionBoxDown.png "ecere/elements"
157         $(EAR) awq $(TARGET) ../../ecere/res/vanilla/ecere/elements/optionBoxSelected.png ../../ecere/res/vanilla/ecere/elements/optionBoxSelectedDown.png ../../ecere/res/vanilla/ecere/elements/optionBoxUp.png "ecere/elements"
158         $(EAR) awq $(TARGET) ../../ecere/res/vanilla/ecere/places/driveRemote.png ../../ecere/res/vanilla/ecere/places/folder.png ../../ecere/res/vanilla/ecere/places/folderRemote.png ../../ecere/res/vanilla/ecere/places/networkServer.png ../../ecere/res/vanilla/ecere/places/networkWorkgroup.png "ecere/places"
159         $(EAR) awq $(TARGET) ../../ecere/res/vanilla/ecere/status/folderOpen.png "ecere/status"
160         $(EAR) awq $(TARGET) locale/zh_CN/LC_MESSAGES/extract.mo "locale/zh_CN/LC_MESSAGES"
161         $(EAR) awq $(TARGET) locale/es_ES/LC_MESSAGES/extract.mo "locale/es_ES/LC_MESSAGES"
162
163 # SYMBOL RULES
164
165 $(OBJ)extract.sym: extract.ec
166         $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c extract.ec -o $(OBJ)extract.sym
167
168 # C OBJECT RULES
169
170 $(OBJ)extract.c: extract.ec $(OBJ)extract.sym | $(SYMBOLS)
171         $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c extract.ec -o $(OBJ)extract.c -symbols $(OBJ)
172
173 # IMPLICIT OBJECT RULE
174
175 $(OBJ)%$(O) : $(OBJ)%.c
176         $(CC) $(CFLAGS) $(FVISIBILITY) -c $< -o $@
177
178 # OBJECT RULES
179
180 $(OBJ)$(MODULE).main$(O): $(OBJ)$(MODULE).main.c
181         $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.c -o $(OBJ)$(MODULE).main$(O)
182
183 clean: objdir
184         $(call rmq,$(OBJ)$(MODULE).main.c $(OBJ)$(MODULE).main.ec $(OBJ)$(MODULE).main$(I) $(OBJ)$(MODULE).main$(S) $(TARGET))
185         $(call rmq,$(OBJECTS))
186         $(call rmq,$(COBJECTS))
187         $(call rmq,$(IMPORTS))
188         $(call rmq,$(SYMBOLS))
189
190 realclean:
191         $(call rmrq,$(OBJ))
192
193 distclean:
194         $(call rmrq,obj/)