Add support for __builtin_strpbrk()
[smatch.git] / Makefile
blobda4a47a61fe43d07f74668a4b6bd724c368aa532
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 compile graph sparse test-linearize example test-unssa test-dissect
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 dissect.o
35 LIB_FILE= libsparse.a
36 SLIB_FILE= libsparse.so
38 LIBS=$(LIB_FILE)
40 all: $(PROGRAMS) $(SLIB_FILE)
42 install: sparse $(SLIB_FILE) bin-dir
43 if test $< -nt $(BINDIR)/sparse ; then install -v $< $(BINDIR)/sparse ; install -v $(SLIB_FILE) $(BINDIR) ; fi
45 bin-dir:
46 @if ! test -d $(BINDIR); then \
47 echo "No '$(BINDIR)' directory to install in"; \
48 echo "Please create it and add it to your PATH"; \
49 exit 1; \
52 .PHONY: bin-dir
54 test-lexing: test-lexing.o $(LIBS)
55 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
57 test-parsing: test-parsing.o $(LIBS)
58 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
60 test-linearize: test-linearize.o $(LIBS)
61 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
63 test-sort: test-sort.o $(LIBS)
64 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
66 compile: compile.o compile-i386.o $(LIBS)
67 $(CC) $(LDFLAGS) -o $@ $< compile-i386.o $(LIBS)
69 obfuscate: obfuscate.o $(LIBS)
70 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
72 sparse: check.o $(LIBS)
73 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
75 graph: graph.o $(LIBS)
76 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
78 example: example.o $(LIBS)
79 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
81 test-unssa: test-unssa.o $(LIBS)
82 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
84 test-dissect: test-dissect.o $(LIBS)
85 $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
87 $(LIB_FILE): $(LIB_OBJS)
88 $(AR) rcs $@ $(LIB_OBJS)
90 $(SLIB_FILE): $(LIB_OBJS)
91 $(CC) -shared -o $@ $(LIB_OBJS)
93 evaluate.o: $(LIB_H)
94 expression.o: $(LIB_H)
95 lib.o: $(LIB_H)
96 allocate.o: $(LIB_H)
97 parse.o: $(LIB_H)
98 pre-process.o: $(LIB_H) pre-process.h
99 scope.o: $(LIB_H)
100 show-parse.o: $(LIB_H)
101 symbol.o: $(LIB_H)
102 expand.o: $(LIB_H)
103 linearize.o: $(LIB_H)
104 flow.o: $(LIB_H)
105 cse.o: $(LIB_H)
106 simplify.o: $(LIB_H)
107 memops.o: $(LIB_H)
108 liveness.o: $(LIB_H)
109 sort.o: $(LIB_H)
110 inline.o: $(LIB_H)
111 target.o: $(LIB_H)
112 test-lexing.o: $(LIB_H)
113 test-parsing.o: $(LIB_H)
114 test-linearize.o: $(LIB_H)
115 test-dissect.o: $(LIB_H) dissect.h
116 compile.o: $(LIB_H) compile.h
117 compile-i386.o: $(LIB_H) compile.h
118 tokenize.o: $(LIB_H)
119 check.o: $(LIB_H)
120 obfuscate.o: $(LIB_H)
121 example.o: $(LIB_H)
122 storage.o: $(LIB_H) storage.h
123 dissect.o: $(LIB_H) dissect.h
124 graph.o: $(LIB_H)
126 compat-linux.o: compat/strtold.c compat/mmap-blob.c \
127 $(LIB_H)
128 compat-solaris.o: compat/mmap-blob.c $(LIB_H)
129 compat-mingw.o: $(LIB_H)
130 compat-cygwin.o: $(LIB_H)
132 pre-process.h:
133 echo "#define GCC_INTERNAL_INCLUDE \"`$(CC) -print-file-name=include`\"" > pre-process.h
135 clean:
136 rm -f *.[oasi] core core.[0-9]* $(PROGRAMS) $(SLIB_FILE) pre-process.h
138 % : SCCS/s.%s