rc: simplify Makefile, use yacc default rule (thanks k0ga)

This commit is contained in:
cinap_lenrek 2022-01-03 22:48:44 +00:00
parent 1a90e04c05
commit 699d2e0ed9

View file

@ -17,7 +17,7 @@ OFILES=\
var.o\ var.o\
havefork.o\ havefork.o\
unix.o\ unix.o\
y.tab.o\ syn.o\
HFILES=rc.h\ HFILES=rc.h\
y.tab.h\ y.tab.h\
@ -27,6 +27,7 @@ HFILES=rc.h\
getflags.h\ getflags.h\
YFILES=syn.y YFILES=syn.y
YFLAGS=-d
PREFIX=/usr/local PREFIX=/usr/local
@ -39,13 +40,12 @@ install: $(TARG) rcmain.unix
$(TARG): $(OFILES) $(TARG): $(OFILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(TARG) $(OFILES) $(CC) $(CFLAGS) $(LDFLAGS) -o $(TARG) $(OFILES)
y.tab.h y.tab.c: $(YFILES) y.tab.h: syn.c
$(YACC) -d $(YFILES)
unix.o: unix.c unix.o: unix.c
$(CC) $(CFLAGS) '-DPREFIX="$(PREFIX)"' -c unix.c $(CC) $(CFLAGS) '-DPREFIX="$(PREFIX)"' -c unix.c
$(OFILES): $(HFILES) $(OFILES): $(HFILES)
clean: clean:
rm -f $(OFILES) $(TARG) y.tab.? y.debug rm -f $(OFILES) $(TARG) syn.c y.tab.? y.debug