]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/install+setup/install/Makefile
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[people/pmueller/ipfire-2.x.git] / src / install+setup / install / Makefile
1 #
2 # $Id: Makefile,v 1.6.2.2 2006/01/11 01:01:38 franck78 Exp $
3 #
4
5 CC = gcc
6 CFLAGS = -Os -Wall
7 INCLUDE = -I/install/include
8
9 LD = gcc
10 LDFLAGS = -L/install/lib
11 LIBS = -lnewt -lslang -lpci
12
13 COMPILE = $(CC) -c $(INCLUDE) $(CFLAGS)
14
15 LINK = $(LD) $(LDFLAGS)
16
17 all : programs
18
19 programs : install install2
20
21 clean :
22 -rm -f *.o install core
23
24 ######
25 # Macro to extract from the full set of translations only what is really used
26 # into the installer (install&install2). Each needed entry have a "comment
27 # inside the main source file"
28 define lang_install
29 rm $(OBJS3); \
30 for i in /usr/src/langs/*/install/lang_*.c ; do \
31 path=$${i%/*}/; \
32 file=../libsmooth/$${i/$$path/}; \
33 echo "#include \"libsmooth.h\"" > $$file; \
34 grep "^char \*" $$i >> $$file; \
35 echo "#include \"libsmooth.h\"" > $$file; \
36 grep "^char \*" $$i >> $$file; \
37 grep "^/\* TR_*" ../install/$$SELECT|xargs -i% grep -FA1 % $$i >> $$file; \
38 echo "};">>$$file; \
39 done
40 #build the tr_strings include file
41 awk 'BEGIN{ print"enum trstrings{" } \
42 $$0 ~/\/\* (TR_[A-Z0-9_]*)/ {print $$2"," }\
43 END{ print "};" }' ../libsmooth/lang_en.c > ../libsmooth/langs.h
44 endef
45
46 lang_install:
47 SELECT=main.c; \
48 $(lang_install)
49 cp ../libsmooth/langs.h main_langs.h
50
51 lang_install2:
52 SELECT=install2.c; \
53 $(lang_install)
54 cp ../libsmooth/langs.h install_langs.h
55
56 OBJS1=main.o ide.o cdrom.o nic.o net.o config.o pcmcia.o usb.o scsi.o
57 OBJS2=install2.o upgrade-v12-v13.o upgrade-v130-v140.o
58 OBJS3=../libsmooth/main.o ../libsmooth/netstuff.o ../libsmooth/varval.o
59
60 install: lang_install $(OBJS1) $(OBJS3) install.h ../libsmooth/langs.h ../libsmooth/libsmooth.h /install/include/newt.h
61 $(LINK) $(OBJS1) $(OBJS3) -o $@ $(LIBS)
62
63 install2: lang_install2 $(OBJS2) $(OBJS3)
64 #strange 'make': even if files $OBJS3 are deleted, they are not recompiled,
65 #so I explicitly recompile them (needed because langs.h have changed).
66 $(foreach I, $(OBJS3), $(COMPILE) $(patsubst %.o,%.c,$(I)) -o $(I);)
67 $(LINK) $(OBJS2) $(OBJS3) -o $@ $(LIBS)
68
69 %.o : %.c
70 $(COMPILE) $< -o $@
71
72 .PHONY : lang_install lang_install2 clean