7 CFLAGS
=-O
-g
-Wall
-Wwrite-strings
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
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
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"; \
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
)
69 expression.o
: $(LIB_H
)
73 pre-process.o
: $(LIB_H
) pre-process.h
75 show-parse.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
96 compat-linux.o
: compat
/strtold.c compat
/id-files-stat.c compat
/mmap-blob.c \
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
)
103 echo
"#define GCC_INTERNAL_INCLUDE \"`$(CC) -print-file-name=include`\"" > pre-process.h
106 rm -f
*.
[oasi
] core core.
[0-9]* $(PROGRAMS
) pre-process.h