aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorBruce Korb <korbb@gcc.gnu.org>1998-06-03 07:29:13 +0000
committerBruce Korb <korbb@gcc.gnu.org>1998-06-03 07:29:13 +0000
commitfb2aebdb8153a57662475fd9bb5d93827ed15a6f (patch)
tree0d29a52ed0480f0ee8134bf367b7b87deffe141d /contrib
parentbc516719eccb6e941f036a763ba5a7bdbd1b0d80 (diff)
downloadgcc-fb2aebdb8153a57662475fd9bb5d93827ed15a6f.zip
gcc-fb2aebdb8153a57662475fd9bb5d93827ed15a6f.tar.gz
gcc-fb2aebdb8153a57662475fd9bb5d93827ed15a6f.tar.bz2
This is a more workable makefile
From-SVN: r20208
Diffstat (limited to 'contrib')
-rw-r--r--contrib/fixinc/Makefile43
1 files changed, 28 insertions, 15 deletions
diff --git a/contrib/fixinc/Makefile b/contrib/fixinc/Makefile
index c3b0b4f..5b622a6 100644
--- a/contrib/fixinc/Makefile
+++ b/contrib/fixinc/Makefile
@@ -16,21 +16,28 @@ AG_TEXT = $(SH_TARGET) fixincl.x \
inclhack.def inclhack.tpl hackshell.tpl fixincl.tpl
TARGETS = $(SH_TARGET) $(BIN_TARGET)
-default : fixincl.sh
+default : gen
all : $(TARGETS)
sh : $(SH_TARGET)
+gen : $(SH_TARGET) fixincl.x
$(OBJ): $(HDR)
-fixincl.o: fixincl.x
fixincl: $(OBJ)
+ @echo $(CC) -o $@ $(OBJ) $(LIB) ; \
if $(CC) -o $@ $(OBJ) $(LIB) ; then : ; else \
rm -f $@ ; (echo "#! /bin/sh" ; echo exit 1 ) > $@ ; \
chmod 777 $@ ; fi
regex.o: regex.c
- $(CC) -g -DSTDC_HEADERS=1 -c regex.c
+ -$(CC) -g -DSTDC_HEADERS=1 -c regex.c
+
+fixincl.o : fixincl.x fixincl.c
+ -$(CC) $(CFLAGS) -o $@ -c fixincl.c
+
+server.o : server.c server.h
+ -$(CC) $(CFLAGS) -o $@ -c server.c
fixincl.x: fixincl.tpl inclhack.def
@if ( autogen --help > /dev/null 2>&1 ) ; then \
@@ -44,25 +51,31 @@ inclhack.sh: inclhack.def inclhack.tpl hackshell.tpl
autogen inclhack.def ; \
else echo You need to install autogen ; touch $@ ; fi
-fixincl.sh: inclhack.def inclhack.tpl fixincl inclhack.sh
- @if ( ./fixincl -v > /dev/null 2>&1 ) ; then \
- if ( autogen --help > /dev/null 2>&1 ) ; then \
+fixincl.sh: inclhack.def inclhack.tpl
+ @if ( autogen --help > /dev/null 2>&1 ) ; then \
echo autogen -DPROGRAM=1 -b fixincl inclhack.def ; \
autogen -DPROGRAM=1 -b fixincl inclhack.def ; touch $@ ; \
- else echo You need to install autogen ; touch $@ ; fi ; \
- else cp inclhack.sh $@ ; echo cp inclhack.sh $@ ; fi
+ else echo You need to install autogen ; touch $@ ; fi ; \
clean:
- rm -f *.o fixincl
+ rm -f *.o $(TARGETS) fixincl.x
-install: fixincl.sh
+# 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)
@rm -f $(DESTDIR)/fixinc.sh ; \
+ if ( ./fixincl -v > /dev/null 2>&1 ) ; then \
echo cp fixincl.sh $(DESTDIR)/fixinc.sh ; \
cp fixincl.sh $(DESTDIR)/fixinc.sh ; \
- chmod 555 $(DESTDIR)/fixinc.sh
- @echo check for fixincl copy...
- @if ( ./fixincl -v > /dev/null 2>&1 ) ; then \
- rm -f $(DESTDIR)/fixincl ; \
+ chmod 555 $(DESTDIR)/fixinc.sh ; \
+ rm -f $(DESTDIR)/fixincl ; \
echo cp fixincl $(DESTDIR) ; \
cp fixincl $(DESTDIR) ; \
- chmod 555 $(DESTDIR)/fixincl ; fi
+ chmod 555 $(DESTDIR)/fixincl ; \
+ else \
+ echo cp inclhack.sh $(DESTDIR)/fixinc.sh ; \
+ cp inclhack.sh $(DESTDIR)/fixinc.sh ; \
+ fi