-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
85 lines (62 loc) · 2.03 KB
/
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# add -DWITH_RATFOR to your C/CPPFLAGS if you want ratfor support
# adds about 4 KB to binary size
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
LIBDIR = $(PREFIX)/lib
MANDIR = $(PREFIX)/share/man
XOBJ = main.o sub1.o sub2.o sub3.o header.o wcio.o parser.o lsearch.o
LOBJ = allprint.o libmain.o reject.o yyless.o yywrap.o \
allprint_w.o reject_w.o yyless_w.o reject_e.o yyless_e.o
GENH = nceucform.h ncform.h nrform.h
WFLAGS = -DEUC -DJLSLEX -DWOPTION
EFLAGS = -DEUC -DJLSLEX -DEOPTION
RANLIB = ranlib
INSTALL = install
HOSTCC = $(CC)
.c.o: ; $(CC) -c $(CFLAGS) $(CPPFLAGS) $(WARN) $<
.y.c: ; $(YACC) -o $@ $<
all: lex libl.a
form2hdr: form2hdr.c
$(HOSTCC) $(HOSTCFLAGS) form2hdr.c -o $@
$(GENH): %.h: % ; ./form2hdr -c $< > $@
lex: $(XOBJ)
$(CC) $(LDFLAGS) $(XOBJ) $(LIBS) -o lex
libl.a: $(LOBJ)
rm -f $@
$(AR) cru $@ $(LOBJ)
$(RANLIB) $@
allprint_w.o: allprint.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(WARN) $(WFLAGS) allprint.c -o $@
reject_w.o: reject.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(WARN) $(WFLAGS) reject.c -o $@
yyless_w.o: yyless.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(WARN) $(WFLAGS) yyless.c -o $@
reject_e.o: reject.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(WARN) $(EFLAGS) reject.c -o $@
yyless_e.o: yyless.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(WARN) $(EFLAGS) yyless.c -o $@
install: lex lex.1 libl.a
$(INSTALL) -D -m 755 lex $(DESTDIR)$(BINDIR)/lex
$(INSTALL) -D -m 644 libl.a $(DESTDIR)$(LIBDIR)/libl.a
$(INSTALL) -D -m 644 lex.1 $(DESTDIR)$(MANDIR)/man1/lex.1
clean:
rm -f lex libl.a $(XOBJ) $(LOBJ) $(GENH) parser.c form2hdr core log *~
mrproper: clean
allprint.o: allprint.c
header.o: header.c ldefs.h
libmain.o: libmain.c
main.o: main.c once.h ldefs.h sgs.h $(GENH) lzcomp.h
reject.o: reject.c
sub1.o: sub1.c ldefs.h
sub2.o: sub2.c ldefs.h
sub3.o: sub3.c ldefs.h search.h
parser.o: parser.y ldefs.h
yyless.o: yyless.c
yywrap.o: yywrap.c
lsearch.o: search.h
wcio.o: ldefs.h
$(GENH): form2hdr
.PHONY: all clean mrproper install
# prevent GNU make from deleting parser.c after "all" finishes
# it could be needed for debugging.
.SECONDARY: parser.c