Commit | Line | Data |
---|---|---|
800ffe89 NW |
1 | DEFINES = -DDEBUG -DCONFIGURE |
2 | #DEFINES = -DDEBUG -DUNTRUSTED -DCONFIGURE | |
3 | LDFLAGS = | |
4 | CFLAGS = -g -O -Wall -pipe | |
5 | LIBS = -lutil | |
6 | SRCS = init.c ttytab.c configure.c cf_table.c utils.c | |
7 | OBJS = init.o ttytab.o configure.o cf_table.o utils.o | |
8 | INC = init.h prototypes.h | |
9 | BIN = /sbin/init | |
10 | BAK = .old | |
11 | MAN = /usr/share/man/cat8/init.0 | |
12 | #CC = /usr/local/gcc-2.3.3/bin/gcc | |
13 | MKDEP = mkdep | |
14 | TAGS = ctags | |
15 | ||
16 | ||
17 | all! | |
18 | @[ -f .test ] && exec make test || \ | |
19 | exec make init CC="$(CC)" DEFINES="$(DEFINES)" OBJS="$(OBJS)" | |
20 | ||
21 | ||
22 | test! .test | |
23 | exec make init CC="$(CC)" DEFINES="$(DEFINES) -DTESTRUN" OBJS="$(OBJS) fake_syslog.c" | |
24 | ||
25 | init: $(OBJS) | |
26 | $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $(OBJS) $(LIBS) | |
27 | ||
28 | init.0: init.8 | |
29 | nroff -mandoc init.8 > init.0 | |
30 | ||
31 | clean! | |
32 | -rm -f $(OBJS) init init.0 .test .depend tags | |
33 | ||
34 | install! init init.0 | |
35 | [ -f $(BIN)$(ORI) ] || mv -f $(BIN) $(BIN)$(ORI) | |
36 | -mv -f $(BIN) $(BIN)$(BAK) | |
37 | install -c -s -o bin -g bin -m 0555 -s init $(BIN) | |
38 | install -c -o bin -g bin -m 0444 init.0 $(MAN) | |
39 | [ -f /etc/init.conf ] || install -c -o bin -g wheel -m 644 init.conf /etc | |
40 | ||
41 | depend! | |
42 | $(MKDEP) $(DEFINES) $(SRCS) | |
43 | ||
44 | tags! | |
45 | $(TAGS) $(SRCS) | |
46 | ||
47 | .test: | |
48 | make clean | |
49 | touch .test | |
50 | ||
51 | .c.o: | |
52 | $(CC) -c $(CFLAGS) $(DEFINES) $< | |
53 |