Allow parsing of nested functions.
[smatch.git] / Makefile
blob29b49811f27c9eb0a8c128fdb491b7437d72fc64
2 # Turkey time!
4 OS=linux
6 CC=gcc
7 CFLAGS=-O -g -Wall -Wwrite-strings
8 LDFLAGS=-g
9 AR=ar
11 PREFIX=$(HOME)
12 PROGRAMS=test-lexing test-parsing obfuscate check compile test-linearize
14 LIB_H= token.h parse.h lib.h symbol.h scope.h expression.h target.h \
15 linearize.h bitmap.h ident-list.h compat.h flow.h
17 LIB_OBJS= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
18 expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
19 sort.o flow.o cse.o simplify.o memops.o liveness.o compat-$(OS).o
21 LIB_FILE= sparse.a
22 LIBS=$(LIB_FILE)
24 all: $(PROGRAMS)
27 # Install the 'check' binary as 'sparse', just to confuse people.
29 # "The better to keep you on your toes, my dear".
31 install: check bin-dir
32 if test $< -nt $(PREFIX)/bin/sparse ; then install -v $< $(PREFIX)/bin/sparse ; fi
34 bin-dir:
35 @if ! test -d $(PREFIX)/bin; then \
36 echo "No '$(PREFIX)/bin' directory to install in"; \
37 echo "Please create it and add it to your PATH"; \
38 exit 1; \
41 .PHONY: bin-dir
43 test-lexing: test-lexing.o $(LIB_FILE)
44 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
46 test-parsing: test-parsing.o $(LIB_FILE)
47 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
49 test-linearize: test-linearize.o $(LIB_FILE)
50 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
52 test-sort: test-sort.o $(LIB_FILE)
53 gcc $(LDFLAGS) -o $@ $< $(LIBS)
55 compile: compile.o compile-i386.o $(LIB_FILE)
56 $(CC) $(LDFLAGS) -o $@ $< compile-i386.o $(LIBS)
58 obfuscate: obfuscate.o $(LIB_FILE)
59 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
61 check: check.o $(LIB_FILE)
62 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
64 $(LIB_FILE): $(LIB_OBJS)
65 $(AR) rcs $(LIB_FILE) $(LIB_OBJS)
67 evaluate.o: $(LIB_H)
68 expression.o: $(LIB_H)
69 lib.o: $(LIB_H)
70 parse.o: $(LIB_H)
71 pre-process.o: $(LIB_H) pre-process.h
72 scope.o: $(LIB_H)
73 show-parse.o: $(LIB_H)
74 symbol.o: $(LIB_H)
75 expand.o: $(LIB_H)
76 linearize.o: $(LIB_H)
77 flow.o: $(LIB_H)
78 cse.o: $(LIB_H)
79 simplify.o: $(LIB_H)
80 memops.o: $(LIB_H)
81 liveness.o: $(LIB_H)
82 sort.o: $(LIB_H)
83 inline.o: $(LIB_H)
84 target.o: $(LIB_H)
85 test-lexing.o: $(LIB_H)
86 test-parsing.o: $(LIB_H)
87 test-linearize.o: $(LIB_H)
88 compile.o: $(LIB_H) compile.h
89 compile-i386.o: $(LIB_H) compile.h
90 tokenize.o: $(LIB_H)
91 check.o: $(LIB_H)
92 obfuscate.o: $(LIB_H)
94 compat-linux.o: compat/strtold.c compat/id-files-stat.c compat/mmap-blob.c \
95 $(LIB_H)
96 compat-solaris.o: compat/id-files-stat.c compat/mmap-blob.c $(LIB_H)
97 compat-mingw.o: $(LIB_H)
98 compat-cygwin.o: $(LIB_H)
100 pre-process.h:
101 echo "#define GCC_INTERNAL_INCLUDE \"`$(CC) -print-file-name=include`\"" > pre-process.h
103 clean:
104 rm -f *.[oasi] core core.[0-9]* $(PROGRAMS) pre-process.h