Changed sbin to ${BINDIR} so the right things would happen if ../Makefile.inc
[unix-history] / sbin / init.chmr / Makefile.chmr
CommitLineData
800ffe89
NW
1DEFINES = -DDEBUG -DCONFIGURE
2#DEFINES = -DDEBUG -DUNTRUSTED -DCONFIGURE
3LDFLAGS =
4CFLAGS = -g -O -Wall -pipe
5LIBS = -lutil
6SRCS = init.c ttytab.c configure.c cf_table.c utils.c
7OBJS = init.o ttytab.o configure.o cf_table.o utils.o
8INC = init.h prototypes.h
9BIN = /sbin/init
10BAK = .old
11MAN = /usr/share/man/cat8/init.0
12#CC = /usr/local/gcc-2.3.3/bin/gcc
13MKDEP = mkdep
14TAGS = ctags
15
16
17all!
18 @[ -f .test ] && exec make test || \
19 exec make init CC="$(CC)" DEFINES="$(DEFINES)" OBJS="$(OBJS)"
20
21
22test! .test
23 exec make init CC="$(CC)" DEFINES="$(DEFINES) -DTESTRUN" OBJS="$(OBJS) fake_syslog.c"
24
25init: $(OBJS)
26 $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $(OBJS) $(LIBS)
27
28init.0: init.8
29 nroff -mandoc init.8 > init.0
30
31clean!
32 -rm -f $(OBJS) init init.0 .test .depend tags
33
34install! 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
41depend!
42 $(MKDEP) $(DEFINES) $(SRCS)
43
44tags!
45 $(TAGS) $(SRCS)
46
47.test:
48 make clean
49 touch .test
50
51.c.o:
52 $(CC) -c $(CFLAGS) $(DEFINES) $<
53