4 CFLAGS
=-O
-g
-Wall
-Wwrite-strings
9 PROGRAMS
=test-lexing test-parsing obfuscate
check compile test-linearize
11 LIB_H
= token.h parse.h lib.h symbol.h scope.h expression.h target.h \
12 linearize.h bitmap.h ident-list.h compat.h flow.h
14 LIB_OBJS
= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
15 expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
16 sort.o flow.o cse.o compat-
$(OS
).o
24 # Install the 'check' binary as 'sparse', just to confuse people.
26 # "The better to keep you on your toes, my dear".
28 install: check bin-dir
29 if
test $< -nt
$(PREFIX
)/bin
/sparse
; then
install -v
$< $(PREFIX
)/bin
/sparse
; fi
32 @if
! test -d
$(PREFIX
)/bin
; then \
33 echo
"No '$(PREFIX)/bin' directory to install in"; \
34 echo
"Please create it and add it to your PATH"; \
40 test-lexing
: test-lexing.o
$(LIB_FILE
)
41 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
43 test-parsing
: test-parsing.o
$(LIB_FILE
)
44 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
46 test-linearize
: test-linearize.o
$(LIB_FILE
)
47 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
49 test-sort
: test-sort.o
$(LIB_FILE
)
50 gcc
$(LDFLAGS
) -o
$@
$< $(LIBS
)
52 compile
: compile.o compile-i386.o
$(LIB_FILE
)
53 $(CC
) $(LDFLAGS
) -o
$@
$< compile-i386.o
$(LIBS
)
55 obfuscate
: obfuscate.o
$(LIB_FILE
)
56 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
58 check: check.o
$(LIB_FILE
)
59 $(CC
) $(LDFLAGS
) -o
$@
$< $(LIBS
)
61 $(LIB_FILE
): $(LIB_OBJS
)
62 $(AR
) rcs
$(LIB_FILE
) $(LIB_OBJS
)
65 expression.o
: $(LIB_H
)
68 pre-process.o
: $(LIB_H
) pre-process.h
70 show-parse.o
: $(LIB_H
)
78 test-lexing.o
: $(LIB_H
)
79 test-parsing.o
: $(LIB_H
)
80 test-linearize.o
: $(LIB_H
)
81 compile.o
: $(LIB_H
) compile.h
82 compile-i386.o
: $(LIB_H
) compile.h
87 compat-linux.o
: compat
/strtold.c compat
/id-files-stat.c compat
/mmap-blob.c \
89 compat-solaris.o
: compat
/id-files-stat.c compat
/mmap-blob.c
$(LIB_H
)
90 compat-mingw.o
: $(LIB_H
)
91 compat-cygwin.o
: $(LIB_H
)
94 echo
"#define GCC_INTERNAL_INCLUDE \"`$(CC) -print-file-name=include`\"" > pre-process.h
97 rm -f
*.
[oasi
] core core.
[0-9]* $(PROGRAMS
) pre-process.h