2 # $Id: Makefile,v 1.6.2.2 2006/01/11 01:01:38 franck78 Exp $
7 INCLUDE
= -I
/install/include
10 LDFLAGS
= -L
/install/lib
11 LIBS
= -lnewt
-lslang
-lpci
13 COMPILE
= $(CC
) -c
$(INCLUDE
) $(CFLAGS
)
15 LINK
= $(LD
) $(LDFLAGS
)
19 programs
: install install2
22 -rm -f
*.o
install core
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"
30 for i in
/usr
/src
/langs
/*/install/lang_
*.c
; do \
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; \
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
49 cp ..
/libsmooth
/langs.h main_langs.h
54 cp ..
/libsmooth
/langs.h install_langs.h
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
60 install: lang_install
$(OBJS1
) $(OBJS3
) install.h ..
/libsmooth
/langs.h ..
/libsmooth
/libsmooth.h
/install/include/newt.h
61 $(LINK
) $(OBJS1
) $(OBJS3
) -o
$@
$(LIBS
)
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
)
72 .PHONY
: lang_install lang_install2
clean