1998-03-20 17:19:40 +01:00
|
|
|
|
|
|
|
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
|
|
##
|
|
|
|
## Makefile for constructing the "best" include fixer we can
|
|
|
|
##
|
1998-05-28 11:26:20 +02:00
|
|
|
## $Id: Makefile,v 1.4 1998/08/05 10:20:10 korbb Exp $
|
1998-03-20 17:19:40 +01:00
|
|
|
##
|
|
|
|
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
|
|
|
|
|
|
OBJ = fixincl.o server.o regex.o
|
|
|
|
HDR = server.h regex.h
|
|
|
|
## LIB = -lgen
|
|
|
|
SH_TARGET = inclhack.sh fixincl.sh
|
|
|
|
BIN_TARGET = fixincl
|
|
|
|
AG_TEXT = $(SH_TARGET) fixincl.x \
|
|
|
|
inclhack.def inclhack.tpl hackshell.tpl fixincl.tpl
|
|
|
|
TARGETS = $(SH_TARGET) $(BIN_TARGET)
|
|
|
|
|
1998-06-03 09:29:13 +02:00
|
|
|
default : gen
|
1998-03-20 17:19:40 +01:00
|
|
|
|
|
|
|
all : $(TARGETS)
|
|
|
|
sh : $(SH_TARGET)
|
1998-06-03 09:29:13 +02:00
|
|
|
gen : $(SH_TARGET) fixincl.x
|
1998-03-20 17:19:40 +01:00
|
|
|
|
|
|
|
$(OBJ): $(HDR)
|
|
|
|
|
|
|
|
fixincl: $(OBJ)
|
1998-06-03 09:29:13 +02:00
|
|
|
@echo $(CC) -o $@ $(OBJ) $(LIB) ; \
|
1998-03-20 17:19:40 +01:00
|
|
|
if $(CC) -o $@ $(OBJ) $(LIB) ; then : ; else \
|
1998-05-28 11:26:20 +02:00
|
|
|
rm -f $@ ; (echo "#! /bin/sh" ; echo exit 1 ) > $@ ; \
|
|
|
|
chmod 777 $@ ; fi
|
1998-03-20 17:19:40 +01:00
|
|
|
|
|
|
|
regex.o: regex.c
|
1998-06-03 09:29:13 +02:00
|
|
|
-$(CC) -g -DSTDC_HEADERS=1 -c regex.c
|
|
|
|
|
|
|
|
fixincl.o : fixincl.x fixincl.c
|
1998-08-05 12:20:13 +02:00
|
|
|
-$(CC) $(CFLAGS) '-DTARGET_MACHINE="$(TARGET)"' -o $@ -c fixincl.c
|
1998-06-03 09:29:13 +02:00
|
|
|
|
|
|
|
server.o : server.c server.h
|
|
|
|
-$(CC) $(CFLAGS) -o $@ -c server.c
|
1998-03-20 17:19:40 +01:00
|
|
|
|
|
|
|
fixincl.x: fixincl.tpl inclhack.def
|
|
|
|
@if ( autogen --help > /dev/null 2>&1 ) ; then \
|
|
|
|
echo autogen -T fixincl.tpl -b fixincl inclhack.def ; \
|
|
|
|
autogen -T fixincl.tpl -b fixincl inclhack.def ; \
|
|
|
|
else echo You need to install autogen ; touch $@ ; fi
|
|
|
|
|
|
|
|
inclhack.sh: inclhack.def inclhack.tpl hackshell.tpl
|
|
|
|
@if ( autogen --help > /dev/null 2>&1 ) ; then \
|
|
|
|
echo autogen inclhack.def ; \
|
|
|
|
autogen inclhack.def ; \
|
|
|
|
else echo You need to install autogen ; touch $@ ; fi
|
|
|
|
|
1998-06-03 09:29:13 +02:00
|
|
|
fixincl.sh: inclhack.def inclhack.tpl
|
|
|
|
@if ( autogen --help > /dev/null 2>&1 ) ; then \
|
1998-03-20 17:19:40 +01:00
|
|
|
echo autogen -DPROGRAM=1 -b fixincl inclhack.def ; \
|
|
|
|
autogen -DPROGRAM=1 -b fixincl inclhack.def ; touch $@ ; \
|
1998-06-03 09:29:13 +02:00
|
|
|
else echo You need to install autogen ; touch $@ ; fi ; \
|
1998-03-20 17:19:40 +01:00
|
|
|
|
|
|
|
clean:
|
1998-06-03 09:29:13 +02:00
|
|
|
rm -f *.o $(TARGETS) fixincl.x
|
1998-03-20 17:19:40 +01:00
|
|
|
|
1998-06-03 09:29:13 +02:00
|
|
|
# Ensure all the targets are built. If the program "fixincl"
|
|
|
|
# failed to compile, link or load, then we install the
|
|
|
|
# "inclhack.sh" script. Otherwise, we install that program
|
|
|
|
# plus the wrapper script, "fixincl.sh".
|
|
|
|
#
|
|
|
|
install: $(TARGETS)
|
1998-05-28 11:26:20 +02:00
|
|
|
@rm -f $(DESTDIR)/fixinc.sh ; \
|
1998-06-03 09:29:13 +02:00
|
|
|
if ( ./fixincl -v > /dev/null 2>&1 ) ; then \
|
1998-05-28 11:26:20 +02:00
|
|
|
echo cp fixincl.sh $(DESTDIR)/fixinc.sh ; \
|
|
|
|
cp fixincl.sh $(DESTDIR)/fixinc.sh ; \
|
1998-06-03 09:29:13 +02:00
|
|
|
chmod 555 $(DESTDIR)/fixinc.sh ; \
|
1998-08-05 12:20:13 +02:00
|
|
|
rm -f $(DESTDIR)/fixincl ; \
|
1998-05-28 11:26:20 +02:00
|
|
|
echo cp fixincl $(DESTDIR) ; \
|
|
|
|
cp fixincl $(DESTDIR) ; \
|
1998-06-03 09:29:13 +02:00
|
|
|
chmod 555 $(DESTDIR)/fixincl ; \
|
|
|
|
else \
|
|
|
|
echo cp inclhack.sh $(DESTDIR)/fixinc.sh ; \
|
|
|
|
cp inclhack.sh $(DESTDIR)/fixinc.sh ; \
|
|
|
|
fi
|