Fix up dependencies for allocate.c
[smatch.git] / Makefile
blob18dbc2b44e2b6ed0fad83b353573c17d7ff8aae3
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 allocate.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 allocate.o compat-$(OS).o \
20 flow.o cse.o simplify.o memops.o liveness.o
22 LIB_FILE= sparse.a
23 LIBS=$(LIB_FILE)
25 all: $(PROGRAMS)
28 # Install the 'check' binary as 'sparse', just to confuse people.
30 # "The better to keep you on your toes, my dear".
32 install: check bin-dir
33 if test $< -nt $(PREFIX)/bin/sparse ; then install -v $< $(PREFIX)/bin/sparse ; fi
35 bin-dir:
36 @if ! test -d $(PREFIX)/bin; then \
37 echo "No '$(PREFIX)/bin' directory to install in"; \
38 echo "Please create it and add it to your PATH"; \
39 exit 1; \
42 .PHONY: bin-dir
44 test-lexing: test-lexing.o $(LIB_FILE)
45 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
47 test-parsing: test-parsing.o $(LIB_FILE)
48 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
50 test-linearize: test-linearize.o $(LIB_FILE)
51 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
53 test-sort: test-sort.o $(LIB_FILE)
54 gcc $(LDFLAGS) -o $@ $< $(LIBS)
56 compile: compile.o compile-i386.o $(LIB_FILE)
57 $(CC) $(LDFLAGS) -o $@ $< compile-i386.o $(LIBS)
59 obfuscate: obfuscate.o $(LIB_FILE)
60 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
62 check: check.o $(LIB_FILE)
63 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
65 $(LIB_FILE): $(LIB_OBJS)
66 $(AR) rcs $(LIB_FILE) $(LIB_OBJS)
68 evaluate.o: $(LIB_H)
69 expression.o: $(LIB_H)
70 lib.o: $(LIB_H)
71 allocate.o: $(LIB_H)
72 parse.o: $(LIB_H)
73 pre-process.o: $(LIB_H) pre-process.h
74 scope.o: $(LIB_H)
75 show-parse.o: $(LIB_H)
76 symbol.o: $(LIB_H)
77 expand.o: $(LIB_H)
78 linearize.o: $(LIB_H)
79 flow.o: $(LIB_H)
80 cse.o: $(LIB_H)
81 simplify.o: $(LIB_H)
82 memops.o: $(LIB_H)
83 liveness.o: $(LIB_H)
84 sort.o: $(LIB_H)
85 inline.o: $(LIB_H)
86 target.o: $(LIB_H)
87 test-lexing.o: $(LIB_H)
88 test-parsing.o: $(LIB_H)
89 test-linearize.o: $(LIB_H)
90 compile.o: $(LIB_H) compile.h
91 compile-i386.o: $(LIB_H) compile.h
92 tokenize.o: $(LIB_H)
93 check.o: $(LIB_H)
94 obfuscate.o: $(LIB_H)
96 compat-linux.o: compat/strtold.c compat/id-files-stat.c compat/mmap-blob.c \
97 $(LIB_H)
98 compat-solaris.o: compat/id-files-stat.c compat/mmap-blob.c $(LIB_H)
99 compat-mingw.o: $(LIB_H)
100 compat-cygwin.o: $(LIB_H)
102 pre-process.h:
103 echo "#define GCC_INTERNAL_INCLUDE \"`$(CC) -print-file-name=include`\"" > pre-process.h
105 clean:
106 rm -f *.[oasi] core core.[0-9]* $(PROGRAMS) pre-process.h