-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.in
322 lines (275 loc) · 12.1 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
DISTDIR = ..
SETUP_VERSION = @SETUP_VERSION_MAJOR@.@SETUP_VERSION_MINOR@.@SETUP_VERSION_RELEASE@
PACKAGE = setup-$(SETUP_VERSION)
DATADIR = .
LOCALEDIR = locale
# @SET_MAKE@
arch := @ARCH@
libc := @LIBC@
os := @OS@
BRANDELF = @BRANDELF@
# If you modify this version, change it's setup.xml and release a new patch.
UNINSTALL_VERSION = 1.0.4
CC = @CC@
CXX = @CXX@
AR = @AR@
# This indicates where the 'setupdb' CVS module is checked out
SETUPDB = @SETUPDB@
IMAGE = @IMAGE@
BRAND = @BRAND@
UPDATES = /loki/updates/loki_uninstall
CONVERT_IMAGE = /loki/patch-tools/convert-image
SETUP_GTK = @SETUP_GTK@
# The supported locales so far
LOCALES = fr de es sv it nl ru en_GB
LD = @LD@
OPTIMIZE = @CFLAGS@
LDFLAGS = @LDFLAGS@
BDYNAMIC = @BDYNAMIC@
HEADERS = -I/usr/X11R6/include -I/usr/local/include
OPTIONS = -DSTUB_UI -DSETUP_VERSION_MAJOR=@SETUP_VERSION_MAJOR@ \
-DSETUP_VERSION_MINOR=@SETUP_VERSION_MINOR@ \
-DSETUP_VERSION_RELEASE=@SETUP_VERSION_RELEASE@ \
-DSETUP_VERSION=\"$(SETUP_VERSION)\" -DSU_PATH=\"@SU_PATH@\" \
-DMOUNT_PATH=\"@MOUNT_PATH@\" -DUMOUNT_PATH=\"@UMOUNT_PATH@\" \
-DDATADIR=\"$(DATADIR)\" -DLOCALEDIR=\"$(LOCALEDIR)\" -DLOKI_PREFIX=\"$(BRAND)\"
CFLAGS += $(OPTIMIZE) $(HEADERS) $(OPTIONS)
CXXFLAGS = $(CFLAGS)
COMMON_OBJS = log.o install_log.o
CORE_OBJS = detect.o plugins.o network.o install.o copy.o file.o loki_launchurl.o bools.o
OBJS = $(COMMON_OBJS) $(CORE_OBJS) main.o
LOKI_UNINSTALL_OBJS = loki_uninstall.o uninstall_ui.o
CARBON_UNINSTALL_OBJS = $(COMMON_OBJS) carbon_uninstall.o uninstall_carbonui.o
UNINSTALL_OBJS = $(COMMON_OBJS) uninstall.o
CHECK_OBJS = $(COMMON_OBJS) $(CORE_OBJS) check.o
CHECK_CARBON_OBJS = $(COMMON_OBJS) $(CORE_OBJS) check_carbon.o
CONSOLE_OBJS = $(OBJS) console_ui.o @CONSOLE_OBJS@
GUI_OBJS = $(OBJS) gtk_ui.o
CARBON_OBJS = $(OBJS) carbon_ui.o
XSU_OBJS = xsu.o pseudo.o
SRCS = $(OBJS:.o=.c) $(CONSOLE_OBJS:.o=.c) $(GUI_OBJS:.o=.c) $(CARBON_OBJS:.o=.c) $(XSU_OBJS:.o=.c) testcd.c
COMMON_LIBS = plugins/libplugins.a @COMMON_LIBS@ \
$(SETUPDB)/$(arch)/libsetupdb.a
LIBS = $(COMMON_LIBS) @LIBS@
ifeq ($(os),Linux)
GUI_LIBS = $(COMMON_LIBS) @LIBS@ @GUI_LIBS@
else
GUI_LIBS = $(COMMON_LIBS) @GUI_LIBS@ @LIBS@
endif
CARBON_LIBS = $(COMMON_LIBS) @LIBS@ @CARBON_LIBS@
CONSOLE_LIBS = $(LIBS) @CONSOLE_LIBS@ -lm
all: do-plugins @DO_DIALOG@ setup $(SETUP_GTK) uninstall xsu
testxml: testxml.o
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS) -lm
loki_uninstall.o: uninstall.c
$(LD) $(LDFLAGS) -c -o $@ $^ $(CFLAGS) -DUNINSTALL_UI -DVERSION=\"$(UNINSTALL_VERSION)\"
loki_uninstall: $(LOKI_UNINSTALL_OBJS) $(SETUPDB)/$(arch)/libsetupdb.a
$(LD) $(LDFLAGS) -o $@ $(LOKI_UNINSTALL_OBJS) $(GUI_LIBS)
carbon_uninstall.o: uninstall.c
$(LD) $(LDFLAGS) -c -o $@ $^ $(CFLAGS) -DUNINSTALL_CARBONUI -DUNINSTALL_UI -DVERSION=\"$(UNINSTALL_VERSION)\"
carbon_uninstall: $(CARBON_UNINSTALL_OBJS) $(SETUPDB)/$(arch)/libsetupdb.a
$(LD) $(LDFLAGS) -o $@ $(CARBON_UNINSTALL_OBJS) $(CARBON_LIBS)
rm -f -R ./uninstall.APP
cp -R ./setup.APP ./uninstall.APP
cp ./carbon/Info.plist.uninstall ./uninstall.APP/Contents/Info.plist
rm -f ./uninstall.APP/Contents/MacOS/setup.carbon
cp ./carbon_uninstall ./uninstall.APP/Contents/MacOS
uninstall: $(UNINSTALL_OBJS) $(COMMON_LIBS)
$(LD) $(LDFLAGS) -o $@ $(UNINSTALL_OBJS) $(CONSOLE_LIBS) @STATIC@
check: $(CHECK_OBJS) $(COMMON_LIBS)
$(LD) $(LDFLAGS) -o $@ $(CHECK_OBJS) $(GUI_LIBS)
check.carbon: $(CHECK_CARBON_OBJS) $(COMMON_LIBS)
$(LD) $(LDFLAGS) -o $@ $(CHECK_CARBON_OBJS) $(CARBON_LIBS)
rm -f -R ./check.APP
cp -R ./setup.APP ./check.APP
cp ./carbon/Info.plist.check ./check.APP/Contents/Info.plist
rm -f ./check.APP/Contents/MacOS/setup.carbon
cp ./check.carbon ./check.APP/Contents/MacOS
testcd: testcd.o $(CORE_OBJS) $(COMMON_OBJS) $(COMMON_LIBS)
$(LD) $(LDFLAGS) -o $@ $^ @LIBS@ @CONSOLE_LIBS@ @STATIC@
setup: do-plugins @DO_DIALOG@ $(CONSOLE_OBJS) $(COMMON_LIBS)
$(LD) $(LDFLAGS) -o $@ $(CONSOLE_OBJS) $(CONSOLE_LIBS) @STATIC@
$(SETUP_GTK): $(GUI_OBJS) $(COMMON_LIBS)
$(LD) $(LDFLAGS) -o $@ $(GUI_OBJS) $(GUI_LIBS)
#!!!TODO - Take dependency of dialog libs out of carbon
#!!!TODO - Should we include setup.carbon as part of "all", "install", etc...?
# Carbon needs to be a target all its own
setup.carbon: do-plugins @DO_DIALOG@ $(CARBON_OBJS) $(COMMON_LIBS)
$(LD) $(LDFLAGS) -o $@ $(CARBON_OBJS) $(CARBON_LIBS)
cp setup.carbon setup.APP/Contents/MacOS
xsu: $(XSU_OBJS)
$(LD) $(LDFLAGS) -o $@ $^ @LIBS@ @GUI_LIBS@ @LIBUTIL@ @X11_LIBS@ @LIBINTL@ @EXTRA_LIBS@
do-plugins:
$(MAKE) -C plugins all
do-dialog:
$(MAKE) -C dialog all
install.dbg: all
ifeq ($(DYN_PLUGINS),true)
$(MAKE) -C plugins install.dbg
endif
@if [ -d image/setup.data/bin/$(os)/$(arch)/$(libc) ]; then \
cp setup image/setup.data/bin/$(os)/$(arch); \
cp uninstall image/setup.data/bin/$(os)/$(arch); \
cp $(SETUP_GTK) image/setup.data/bin/$(os)/$(arch)/$(libc); \
fi
install: all
ifeq ($(DYN_PLUGINS),true)
$(MAKE) -C plugins install
endif
@mkdir -p image/setup.data/bin/$(os)/$(arch)/$(libc)
@if [ -d image/setup.data/bin/$(os)/$(arch)/$(libc) ]; then \
cp setup image/setup.data/bin/$(os)/$(arch); \
strip image/setup.data/bin/$(os)/$(arch)/setup; \
$(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/setup; \
cp uninstall image/setup.data/bin/$(os)/$(arch); \
strip image/setup.data/bin/$(os)/$(arch)/uninstall; \
$(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/uninstall; \
cp xsu image/setup.data/bin/$(os)/$(arch)/$(libc); \
strip image/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \
$(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \
cp $(SETUP_GTK) image/setup.data/bin/$(os)/$(arch)/$(libc); \
strip image/setup.data/bin/$(os)/$(arch)/$(libc)/$(SETUP_GTK); \
$(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/$(libc)/$(SETUP_GTK); \
else \
echo No directory to copy the binary files to.; \
echo wanted image/setup.data/bin/${os}/${arch}/${libc}; \
fi
install-setup: setup
@if [ -d $(IMAGE)/setup.data/bin/$(os)/$(arch) ]; then \
cp setup $(IMAGE)/setup.data/bin/$(os)/$(arch); \
strip $(IMAGE)/setup.data/bin/$(os)/$(arch)/setup; \
$(BRANDELF) -t $(os) $(IMAGE)/setup.data/bin/$(os)/$(arch)/setup; \
else \
echo No directory to copy the setup binary file to.; \
fi
install-uninstall: uninstall
@if [ -d $(IMAGE)/setup.data/bin/$(os)/$(arch)/ ]; then \
cp uninstall $(IMAGE)/setup.data/bin/$(os)/$(arch)/uninstall; \
strip $(IMAGE)/setup.data/bin/$(os)/$(arch)/uninstall; \
$(BRANDELF) -t $(os) $(IMAGE)/setup.data/bin/$(os)/$(arch)/uninstall; \
else \
echo No directory to copy the uninstall binary file to.; \
fi
install-image: all install-setup install-uninstall
ifeq ($(DYN_PLUGINS),true)
$(MAKE) -C plugins install
endif
@if [ -d $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc) ]; then \
cp xsu $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc); \
strip $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \
$(BRANDELF) -t $(os) $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \
if [ $(os) = Linux -a -d $(CONVERT_IMAGE) ]; then \
cp uninstall $(CONVERT_IMAGE)/bin/$(os)/$(arch); \
strip $(CONVERT_IMAGE)/bin/$(os)/$(arch)/uninstall; \
$(BRANDELF) -t $(os) $(CONVERT_IMAGE)/bin/$(os)/$(arch)/uninstall; \
fi; \
cp $(SETUP_GTK) $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc); \
strip $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc)/$(SETUP_GTK); \
else \
echo No directory to copy the binary files to.; \
fi
# Pretty LPP-specific
install-check: check
@if [ -d $(IMAGE)/bin/$(os)/$(arch)/ ]; then \
cp check $(IMAGE)/bin/$(os)/$(arch)/; \
strip $(IMAGE)/bin/$(os)/$(arch)/check; \
cp check.glade check.gtk2.glade $(IMAGE)/misc/; \
else \
echo No directory to copy the binary files to.; \
fi
# Copy loki_uninstall and the required files
copy-loki_uninstall: loki_uninstall
@if [ -d $(IMAGE)/bin/$(os)/$(arch)/bin ]; then \
if [ -d $(IMAGE)/bin/$(os)/$(arch)/bin/@GTK_SUBDIR@ ]; then \
cp loki_uninstall $(IMAGE)/bin/$(os)/$(arch)/bin/@GTK_SUBDIR@/$(BRAND)-uninstall; \
strip $(IMAGE)/bin/$(os)/$(arch)/bin/@GTK_SUBDIR@/$(BRAND)-uninstall; \
else \
cp loki_uninstall $(IMAGE)/bin/$(os)/$(arch)/bin/$(BRAND)-uninstall; \
strip $(IMAGE)/bin/$(os)/$(arch)/bin/$(BRAND)-uninstall; \
fi; \
for file in `find image/setup.data -name loki-uninstall.mo -print`; \
do path="$(IMAGE)/`dirname $$file | sed 's,image/setup.data/,,'`"; \
mkdir -p $$path; \
cp $$file $$path; \
done; \
else \
echo No directory to copy the $(BRAND)-uninstall binary file to.; \
fi
copy-image: install-image copy-loki_uninstall po-image
install-loki_uninstall: loki_uninstall
@if [ -d $(IMAGE)/loki_uninstall/bin/$(arch)/$(libc)/ ]; then \
cp loki_uninstall $(IMAGE)/loki_uninstall/bin/$(arch)/$(libc)/; \
strip $(IMAGE)/loki_uninstall/bin/$(arch)/$(libc)/loki_uninstall; \
cp README.loki_uninstall $(IMAGE)/loki_uninstall/README; \
cp icon.xpm uninstall.glade uninstall.gtk2.glade $(IMAGE)/loki_uninstall/; \
for file in `find image/setup.data -name loki-uninstall.mo -print`; \
do path="$(IMAGE)/loki_uninstall/`dirname $$file | sed 's,image/setup.data/,,'`"; \
mkdir -p $$path; \
cp $$file $$path; \
done; \
else \
echo No directory to copy the binary files to.; \
fi
@if [ -d $(UPDATES) ]; then \
rm -rf $(UPDATES)/bin-$(arch)-$(UNINSTALL_VERSION)/; \
mkdir $(UPDATES)/bin-$(arch)-$(UNINSTALL_VERSION)/; \
cp loki_uninstall $(UPDATES)/bin-$(arch)-$(UNINSTALL_VERSION)/; \
strip $(UPDATES)/bin-$(arch)-$(UNINSTALL_VERSION)/loki_uninstall; \
rm -rf $(UPDATES)/data-$(UNINSTALL_VERSION)/; \
mkdir $(UPDATES)/data-$(UNINSTALL_VERSION)/; \
cp README.loki_uninstall $(UPDATES)/data-$(UNINSTALL_VERSION)/README; \
cp icon.xpm uninstall.glade uninstall.gtk2.glade $(UPDATES)/data-$(UNINSTALL_VERSION)/; \
for file in `find image/setup.data -name loki-uninstall.mo -print`; \
do path="$(UPDATES)/data-$(UNINSTALL_VERSION)/`dirname $$file | sed 's,image/setup.data/,,'`"; \
mkdir -p $$path; \
cp $$file $$path; \
done; \
fi
@echo "Don't forget to update the version in setup.xml to $(UNINSTALL_VERSION)"
po-image:
for lang in $(LOCALES); do \
cp -f image/setup.data/locale/$$lang/LC_MESSAGES/*.mo $(IMAGE)/setup.data/locale/$$lang/LC_MESSAGES/; \
if test -d $(CONVERT_IMAGE); then cp -f image/setup.data/locale/$$lang/LC_MESSAGES/loki-uninstall.mo $(CONVERT_IMAGE)/locale/$$lang/LC_MESSAGES/; fi \
done
clean:
$(MAKE) -C plugins clean
$(MAKE) -C dialog clean
rm -f foo.xml core tags *.o
rm -f carbon/*.o
rm -f unrar/*.o
distclean: clean
rm -f Makefile config.cache config.status config.log
rm -f setup $(SETUP_GTK) setup.carbon uninstall loki_uninstall testxml
dist: distclean
cp -r . $(DISTDIR)/$(PACKAGE)
(cd $(DISTDIR)/$(PACKAGE) && rm -r `find . -name CVS`)
(cd $(DISTDIR)/$(PACKAGE) && rm -r `find . -name .cvsignore`)
(cd $(DISTDIR) && tar zcvf $(PACKAGE).tar.gz $(PACKAGE))
rm -rf $(DISTDIR)/$(PACKAGE)
po/setup.po: $(SRCS) image/setup.data/setup.glade
libglade-xgettext image/setup.data/setup.glade > po/setup.po
xgettext -p po -j -d setup --keyword=_ $(SRCS) plugins/*.c
po/loki-uninstall.po: uninstall.c uninstall_ui.c uninstall.glade
libglade-xgettext uninstall.glade > po/loki-uninstall.po
xgettext -p po -j -d loki-uninstall --keyword=_ uninstall.c uninstall_ui.c
gettext: po/setup.po po/loki-uninstall.po
for lang in $(LOCALES); do \
msgfmt -f po/$$lang/setup.po -o image/setup.data/locale/$$lang/LC_MESSAGES/setup.mo; \
msgfmt -f po/$$lang/loki-uninstall.po -o image/setup.data/locale/$$lang/LC_MESSAGES/loki-uninstall.mo; \
done
# This rule merges changes from the newest PO file in all the translated PO files
update-po: po/setup.po po/loki-uninstall.po
for lang in $(LOCALES); do \
msgmerge po/$$lang/setup.po po/setup.po > po/$$lang/tmp; \
mv po/$$lang/tmp po/$$lang/setup.po; \
msgmerge po/$$lang/loki-uninstall.po po/loki-uninstall.po > po/$$lang/tmp; \
mv po/$$lang/tmp po/$$lang/loki-uninstall.po; \
done
dep: depend
depend:
$(MAKE) -C plugins depend
$(MAKE) -C dialog depend
$(CC) -MM $(CFLAGS) $(SRCS) > .depend
ifeq ($(wildcard .depend),.depend)
include .depend
endif