Installer repariert

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@46 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-02-19 13:16:13 +00:00
parent 0e325635f8
commit 10bc6f0635
9 changed files with 732 additions and 841 deletions

View File

@@ -1,5 +1,5 @@
#
# $Id: Makefile,v 1.6.2.2 2006/01/11 01:01:38 franck78 Exp $
# $Id: Makefile,v 1.6 2004/02/24 21:24:10 alanh Exp $
#
CC = gcc
@@ -16,57 +16,18 @@ LINK = $(LD) $(LDFLAGS)
all : programs
programs : install install2
programs : install
clean :
-rm -f *.o install core
######
# Macro to extract from the full set of translations only what is really used
# into the installer (install&install2). Each needed entry have a "comment
# inside the main source file"
define lang_install
rm $(OBJS3); \
for i in /usr/src/langs/*/install/lang_*.c ; do \
path=$${i%/*}/; \
file=../libsmooth/$${i/$$path/}; \
echo "#include \"libsmooth.h\"" > $$file; \
grep "^char \*" $$i >> $$file; \
echo "#include \"libsmooth.h\"" > $$file; \
grep "^char \*" $$i >> $$file; \
grep "^/\* TR_*" ../install/$$SELECT|xargs -i% grep -FA1 % $$i >> $$file; \
echo "};">>$$file; \
done
#build the tr_strings include file
awk 'BEGIN{ print"enum trstrings{" } \
$$0 ~/\/\* (TR_[A-Z0-9_]*)/ {print $$2"," }\
END{ print "};" }' ../libsmooth/lang_en.c > ../libsmooth/langs.h
endef
lang_install:
SELECT=main.c; \
$(lang_install)
cp ../libsmooth/langs.h main_langs.h
OBJS=main.o ide.o cdrom.o nic.o net.o config.o ../libsmooth/libsmooth.o \
pcmcia.o upgrade-v12-v13.o upgrade-v130-v140.o usb.o scsi.o
lang_install2:
SELECT=install2.c; \
$(lang_install)
cp ../libsmooth/langs.h install_langs.h
OBJS1=main.o ide.o cdrom.o nic.o net.o config.o pcmcia.o usb.o scsi.o
OBJS2=install2.o upgrade-v12-v13.o upgrade-v130-v140.o
OBJS3=../libsmooth/main.o ../libsmooth/netstuff.o ../libsmooth/varval.o
install: lang_install $(OBJS1) $(OBJS3) install.h ../libsmooth/langs.h ../libsmooth/libsmooth.h /install/include/newt.h
$(LINK) $(OBJS1) $(OBJS3) -o $@ $(LIBS)
install2: lang_install2 $(OBJS2) $(OBJS3)
#strange 'make': even if files $OBJS3 are deleted, they are not recompiled,
#so I explicitly recompile them (needed because langs.h have changed).
$(foreach I, $(OBJS3), $(COMPILE) $(patsubst %.o,%.c,$(I)) -o $(I);)
$(LINK) $(OBJS2) $(OBJS3) -o $@ $(LIBS)
install: $(OBJS)
$(LINK) $(OBJS) -o $@ $(LIBS)
%.o : %.c
$(COMPILE) $< -o $@
.PHONY : lang_install lang_install2 clean