aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
authorJeff Garzik <jgarzik@pobox.com>2003-09-07 14:11:32 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:01:04 -0700
commitad6e36a417067a3a62e97165c2903a7ad7e33ebb (patch)
tree5b1e05312f0a874bef8f0584cc3d9ef9d1eff125 /Makefile
parenta9a94cfd3e49bca5097467e0be19781ad7ecc567 (diff)
downloadsparse-dev-ad6e36a417067a3a62e97165c2903a7ad7e33ebb.tar.gz
[PATCH] "silly sparse x86 backend"
Here's what I have so far. Comments welcome. It cannot be considered anywhere near complete, but it acts like it generates x86 asm for a bunch of small test cases anyway :) It started out as show-parse.c. The emit_xxx stuff is what I have converted from show-parse pseudo-code into x86 code generation. The x86_xxx stuff is the stuff that remains. FIXMEs abound. I haven't actually tried to assmble anything yet. Just studying what gcc generates, and then what I generate. A few random notes in closing: * function-at-a-time * just does one subl and one addl for stack manipulation, which implies that it has to output everything from post-function cleanup pass (emit_func_post). * however, x86_xxx stuff (not yet converted) will still print out pseudocode. So your output will look like function header psuedocode (i.e. stuff not yet handled) real x86 code If you don't see any pseudocode... you may actually be lucky enough to be able to compile your asm ;-)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 2b614639..d30fc4ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,10 @@
CC=gcc
CFLAGS=-g -Wall
+LDFLAGS=-g
AR=ar
PREFIX=$(HOME)
-PROGRAMS=test-lexing test-parsing obfuscate check
+PROGRAMS=test-lexing test-parsing obfuscate check compile
LIB_H= token.h parse.h lib.h symbol.h scope.h expression.h target.h
@@ -24,16 +25,19 @@ install: check
install -C check $(PREFIX)/bin/sparse
test-lexing: test-lexing.o $(LIB_FILE)
- gcc -o $@ $< $(LIBS)
+ gcc $(LDFLAGS) -o $@ $< $(LIBS)
test-parsing: test-parsing.o $(LIB_FILE)
- gcc -o $@ $< $(LIBS)
+ gcc $(LDFLAGS) -o $@ $< $(LIBS)
+
+compile: compile.o compile-i386.o $(LIB_FILE)
+ gcc $(LDFLAGS) -o $@ $< compile-i386.o $(LIBS)
obfuscate: obfuscate.o $(LIB_FILE)
- gcc -o $@ $< $(LIBS)
+ gcc $(LDFLAGS) -o $@ $< $(LIBS)
check: check.o $(LIB_FILE)
- gcc -o $@ $< $(LIBS)
+ gcc $(LDFLAGS) -o $@ $< $(LIBS)
$(LIB_FILE): $(LIB_OBJS)
$(AR) rcs $(LIB_FILE) $(LIB_OBJS)
@@ -48,6 +52,8 @@ show-parse.o: $(LIB_H)
symbol.o: $(LIB_H)
test-lexing.o: $(LIB_H)
test-parsing.o: $(LIB_H)
+compile.o: $(LIB_H)
+compile-i386.o: $(LIB_H)
tokenize.o: $(LIB_H)
pre-process.h: