-#
-# $Id: Makefile,v 1.6.2.2 2006/01/11 01:01:38 franck78 Exp $
-#
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
CC = gcc
CFLAGS = -Os -Wall
-INCLUDE = -I/install/include
+INCLUDE =
LD = gcc
-LDFLAGS = -L/install/lib
+LDFLAGS =
LIBS = -lnewt -lslang -lpci
COMPILE = $(CC) -c $(INCLUDE) $(CFLAGS)
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
-
-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
+OBJS=main.o config.o ../libsmooth/libsmooth.o unattended.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