7 CFLAGS
=-O
-g
-Wall
-Wwrite-strings
-fpic
12 # For debugging, uncomment the next one
17 # If building with shared libraries, you might
20 # LDFLAGS += -Wl,-rpath,$(BINDIR)
24 PROGRAMS
=test-lexing test-parsing obfuscate compile graph sparse test-linearize example test-unssa test-dissect
25 INST_PROGRAMS
=sparse cgcc
27 LIB_H
= token.h parse.h lib.h symbol.h scope.h expression.h target.h \
28 linearize.h bitmap.h ident-list.h compat.h flow.h allocate.h \
31 LIB_OBJS
= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
32 expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
33 sort.o allocate.o compat-
$(OS
).o ptrlist.o \
34 flow.o cse.o simplify.o memops.o liveness.o storage.o unssa.o dissect.o
37 SLIB_FILE
= libsparse.so
43 install: $(INST_PROGRAMS
) bin-dir
44 for f in
$(INST_PROGRAMS
); do \
45 install -v
$$f $(BINDIR
)/$$f || exit
1; \
49 @if
! test -d
$(BINDIR
); then \
50 echo
"No '$(BINDIR)' directory to install in"; \
51 echo
"Please create it and add it to your PATH"; \
57 test-lexing
: test-lexing.o
$(LIBS
)
58 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
60 test-parsing
: test-parsing.o
$(LIBS
)
61 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
63 test-linearize
: test-linearize.o
$(LIBS
)
64 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
66 test-sort
: test-sort.o
$(LIBS
)
67 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
69 compile
: compile.o compile-i386.o
$(LIBS
)
70 $(CC
) $(LDFLAGS
) -o
$@
$< compile-i386.o
$(LIBS
)
72 obfuscate
: obfuscate.o
$(LIBS
)
73 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
75 sparse
: check.o
$(LIBS
)
76 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
78 graph
: graph.o
$(LIBS
)
79 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
81 example
: example.o
$(LIBS
)
82 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
84 test-unssa
: test-unssa.o
$(LIBS
)
85 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
87 test-dissect
: test-dissect.o
$(LIBS
)
88 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
90 $(LIB_FILE
): $(LIB_OBJS
)
91 $(AR
) rcs
$@
$(LIB_OBJS
)
93 $(SLIB_FILE
): $(LIB_OBJS
)
94 $(CC
) -shared
-o
$@
$(LIB_OBJS
)
97 expression.o
: $(LIB_H
)
101 pre-process.o
: $(LIB_H
) pre-process.h
103 show-parse.o
: $(LIB_H
)
106 linearize.o
: $(LIB_H
)
115 test-lexing.o
: $(LIB_H
)
116 test-parsing.o
: $(LIB_H
)
117 test-linearize.o
: $(LIB_H
)
118 test-dissect.o
: $(LIB_H
) dissect.h
119 compile.o
: $(LIB_H
) compile.h
120 compile-i386.o
: $(LIB_H
) compile.h
123 obfuscate.o
: $(LIB_H
)
125 storage.o
: $(LIB_H
) storage.h
126 dissect.o
: $(LIB_H
) dissect.h
129 compat-linux.o
: compat
/strtold.c compat
/mmap-blob.c \
131 compat-solaris.o
: compat
/mmap-blob.c
$(LIB_H
)
132 compat-mingw.o
: $(LIB_H
)
133 compat-cygwin.o
: $(LIB_H
)
136 echo
"#define GCC_INTERNAL_INCLUDE \"`$(CC) -print-file-name=include`\"" > pre-process.h
139 rm -f
*.
[oasi
] core core.
[0-9]* $(PROGRAMS
) $(SLIB_FILE
) pre-process.h