7 CFLAGS
=-O
-g
-Wall
-Wwrite-strings
12 PROGRAMS
=test-lexing test-parsing obfuscate
check compile test-linearize example
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 \
18 LIB_OBJS
= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
19 expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
20 sort.o allocate.o compat-
$(OS
).o \
21 flow.o cse.o simplify.o memops.o liveness.o storage.o
29 # Install the 'check' binary as 'sparse', just to confuse people.
31 # "The better to keep you on your toes, my dear".
33 install: check bin-dir
34 if
test $< -nt
$(PREFIX
)/bin
/sparse
; then
install -v
$< $(PREFIX
)/bin
/sparse
; fi
37 @if
! test -d
$(PREFIX
)/bin
; then \
38 echo
"No '$(PREFIX)/bin' directory to install in"; \
39 echo
"Please create it and add it to your PATH"; \
45 test-lexing
: test-lexing.o
$(LIB_FILE
)
46 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
48 test-parsing
: test-parsing.o
$(LIB_FILE
)
49 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
51 test-linearize
: test-linearize.o
$(LIB_FILE
)
52 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
54 test-sort
: test-sort.o
$(LIB_FILE
)
55 gcc
$(LDFLAGS
) -o
$@
$< $(LIBS
)
57 compile
: compile.o compile-i386.o
$(LIB_FILE
)
58 $(CC
) $(LDFLAGS
) -o
$@
$< compile-i386.o
$(LIBS
)
60 obfuscate
: obfuscate.o
$(LIB_FILE
)
61 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
63 check: check.o
$(LIB_FILE
)
64 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
66 example
: example.o
$(LIB_FILE
)
67 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
69 $(LIB_FILE
): $(LIB_OBJS
)
70 $(AR
) rcs
$(LIB_FILE
) $(LIB_OBJS
)
73 expression.o
: $(LIB_H
)
77 pre-process.o
: $(LIB_H
) pre-process.h
79 show-parse.o
: $(LIB_H
)
91 test-lexing.o
: $(LIB_H
)
92 test-parsing.o
: $(LIB_H
)
93 test-linearize.o
: $(LIB_H
)
94 compile.o
: $(LIB_H
) compile.h
95 compile-i386.o
: $(LIB_H
) compile.h
100 storage.o
: $(LIB_H
) storage.h
102 compat-linux.o
: compat
/strtold.c compat
/mmap-blob.c \
104 compat-solaris.o
: compat
/mmap-blob.c
$(LIB_H
)
105 compat-mingw.o
: $(LIB_H
)
106 compat-cygwin.o
: $(LIB_H
)
109 echo
"#define GCC_INTERNAL_INCLUDE \"`$(CC) -print-file-name=include`\"" > pre-process.h
112 rm -f
*.
[oasi
] core core.
[0-9]* $(PROGRAMS
) pre-process.h