-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
57 lines (45 loc) · 827 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
include Make.$(shell uname)
TARG=rc
OFILES=\
code.$O\
exec.$O\
getflags.$O\
glob.$O\
here.$O\
io.$O\
lex.$O\
pcmd.$O\
pfnc.$O\
simple.$O\
subr.$O\
trap.$O\
tree.$O\
var.$O\
y.tab.$O\
unix.$O\
havefork.$O\
prompt-$(PROMPT).$O\
HFILES=\
rc.h\
x.tab.h\
io.h\
exec.h\
fns.h\
YFILES=syn.y
all: $(TARG)
$(TARG): $(OFILES)
$(CC) $(ARCHS) -o $(TARG) $(OFILES) $(LFLAGS)
%.$O: %.c $(HFILES)
$(CC) $(ARCHS) $(CFLAGS) -c $*.c
y.tab.h y.tab.c: $(YFILES)
$(YACC) $(YFLAGS) $(YFILES)
x.tab.h: y.tab.h
cmp -s x.tab.h y.tab.h || cp y.tab.h x.tab.h
install: all rcmain.unix rc.1
install -m 755 $(TARG) $(PREFIX)/bin
install -m 644 rcmain.unix $(PREFIX)/lib/rcmain
install -m 644 rc.1 $(PREFIX)/share/man/man1
%: %.c $(HFILES)
$(CC) $(ARCHS) -o $@ $< $(LFLAGS)
clean:
rm -f $(TARG) *.$O $(CLEANFILES)