[PATCH] fix of compound literals on inlining
[smatch.git] / Makefile
blobd7c2d093f6183e895475d8abfde319f3ac63dc70
2 # Turkey time!
4 OS=linux
6 CC=gcc
7 CFLAGS=-O -g -Wall -Wwrite-strings -fpic
8 LDFLAGS=-g
9 AR=ar
12 # For debugging, uncomment the next one
14 CFLAGS += -DDEBUG
17 # If building with shared libraries, you might
18 # want to add this
20 # LDFLAGS += -Wl,-rpath,$(BINDIR)
22 PREFIX=$(HOME)
23 BINDIR=$(PREFIX)/bin
24 PROGRAMS=test-lexing test-parsing obfuscate check compile test-linearize example test-unssa
26 LIB_H= token.h parse.h lib.h symbol.h scope.h expression.h target.h \
27 linearize.h bitmap.h ident-list.h compat.h flow.h allocate.h \
28 storage.h ptrlist.h
30 LIB_OBJS= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
31 expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
32 sort.o allocate.o compat-$(OS).o ptrlist.o \
33 flow.o cse.o simplify.o memops.o liveness.o storage.o unssa.o
35 LIB_FILE= libsparse.a
36 SLIB_FILE= libsparse.so
38 LIBS=$(LIB_FILE)
40 all: $(PROGRAMS) $(SLIB_FILE)
43 # Install the 'check' binary as 'sparse', just to confuse people.
45 # "The better to keep you on your toes, my dear".
47 install: check $(SLIB_FILE) bin-dir
48 if test $< -nt $(PREFIX)/bin/sparse ; then install -v $< $(BINDIR)/sparse ; install -v $(SLIB_FILE) $(BINDIR) ; fi
50 bin-dir:
51 @if ! test -d $(PREFIX)/bin; then \
52 echo "No '$(PREFIX)/bin' directory to install in"; \
53 echo "Please create it and add it to your PATH"; \
54 exit 1; \
57 .PHONY: bin-dir
59 test-lexing: test-lexing.o $(LIBS)
60 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
62 test-parsing: test-parsing.o $(LIBS)
63 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
65 test-linearize: test-linearize.o $(LIBS)
66 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
68 test-sort: test-sort.o $(LIBS)
69 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
71 compile: compile.o compile-i386.o $(LIBS)
72 $(CC) $(LDFLAGS) -o $@ $< compile-i386.o $(LIBS)
74 obfuscate: obfuscate.o $(LIBS)
75 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
77 check: check.o $(LIBS)
78 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
80 example: example.o $(LIBS)
81 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
83 test-unssa: test-unssa.o $(LIBS)
84 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
86 $(LIB_FILE): $(LIB_OBJS)
87 $(AR) rcs $@ $(LIB_OBJS)
89 $(SLIB_FILE): $(LIB_OBJS)
90 $(CC) -shared -o $@ $(LIB_OBJS)
92 evaluate.o: $(LIB_H)
93 expression.o: $(LIB_H)
94 lib.o: $(LIB_H)
95 allocate.o: $(LIB_H)
96 parse.o: $(LIB_H)
97 pre-process.o: $(LIB_H) pre-process.h
98 scope.o: $(LIB_H)
99 show-parse.o: $(LIB_H)
100 symbol.o: $(LIB_H)
101 expand.o: $(LIB_H)
102 linearize.o: $(LIB_H)
103 flow.o: $(LIB_H)
104 cse.o: $(LIB_H)
105 simplify.o: $(LIB_H)
106 memops.o: $(LIB_H)
107 liveness.o: $(LIB_H)
108 sort.o: $(LIB_H)
109 inline.o: $(LIB_H)
110 target.o: $(LIB_H)
111 test-lexing.o: $(LIB_H)
112 test-parsing.o: $(LIB_H)
113 test-linearize.o: $(LIB_H)
114 compile.o: $(LIB_H) compile.h
115 compile-i386.o: $(LIB_H) compile.h
116 tokenize.o: $(LIB_H)
117 check.o: $(LIB_H)
118 obfuscate.o: $(LIB_H)
119 example.o: $(LIB_H)
120 storage.o: $(LIB_H) storage.h
122 compat-linux.o: compat/strtold.c compat/mmap-blob.c \
123 $(LIB_H)
124 compat-solaris.o: compat/mmap-blob.c $(LIB_H)
125 compat-mingw.o: $(LIB_H)
126 compat-cygwin.o: $(LIB_H)
128 pre-process.h:
129 echo "#define GCC_INTERNAL_INCLUDE \"`$(CC) -print-file-name=include`\"" > pre-process.h
131 clean:
132 rm -f *.[oasi] core core.[0-9]* $(PROGRAMS) $(SLIB_FILE) pre-process.h
134 % : SCCS/s.%s