-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (40 loc) · 1.13 KB
/
Makefile
File metadata and controls
61 lines (40 loc) · 1.13 KB
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
# cdoc
# Copyright (c) 2019 Matthew Veety.
# See LICENSE for details
include config.mk
NAME = cdoc
OBJECTS = main.o toks.o util.o args.o \
parse.o printer.o mem.o files.o \
search.o
LEXOBJS = lex.yy.o
SOURCES = $(OBJECTS:.o=.c)
HEADERS = args.h impl.h
all: $(NAME)
allobjs: $(OBJECTS)
alldocs: cdoc.doc
alltests: test_lex test_toks test_makedocline
./test_lex example.c
./test_toks example.c
./test_makedocline
cdoc.doc: $(NAME) $(SOURCES)
./cdoc -f cdoc.doc $(SOURCES)
buildtests: test_lex test_toks test_makedocline
clean:
rm -vf *.o test_*.o test_*.exe *.yy.c test_lex test_toks test_makedocline
distclean: clean
rm -vf $(NAME) $(NAME).exe cdoc.doc
%.h:
%.c:
%.l:
lex.yy.c: lex.l
lex -o lex.yy.c lex.l
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $*.c
$(NAME): $(OBJECTS) $(LEXOBJS)
$(CC) -o $(NAME) $(OBJECTS) $(LEXOBJS)
test_lex: lex.yy.c
$(CC) -o test_lex lex.yy.c -DDOTESTS
test_toks: lex.yy.o toks.o util.o test_toks.o
$(CC) -o test_toks lex.yy.o toks.o util.o test_toks.o
test_makedocline: test_makedocline.o toks.o util.o parse.o mem.o
$(CC) -o test_makedocline test_makedocline.o toks.o util.o parse.o mem.o