diff options
author | bnewbold <bnewbold@eta.mit.edu> | 2009-05-11 13:45:12 -0400 |
---|---|---|
committer | bnewbold <bnewbold@eta.mit.edu> | 2009-05-11 13:45:12 -0400 |
commit | 38e10dc81d5f8f1a2bbededb790e775c0c637d6c (patch) | |
tree | c1c97634df0c0ff31f70d87462ad1f1390fd301f /final_project/work/Makefile | |
parent | ca6558941cf604b2e5ddb8fe38261091a99f6d09 (diff) | |
download | 6.945-38e10dc81d5f8f1a2bbededb790e775c0c637d6c.tar.gz 6.945-38e10dc81d5f8f1a2bbededb790e775c0c637d6c.zip |
files from laura
Diffstat (limited to 'final_project/work/Makefile')
-rw-r--r-- | final_project/work/Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/final_project/work/Makefile b/final_project/work/Makefile new file mode 100644 index 0000000..f8e8f97 --- /dev/null +++ b/final_project/work/Makefile @@ -0,0 +1,43 @@ +all: + rm -f prhello-shim.{c,o} prhello-const.{c,o} *.bin *.so + make install-example + mit-scheme --batch-mode --load prhello.scm + +run: + rm -f prhello-shim.{c,o} prhello-const.{c,o} *.bin *.so + make install-example + mit-scheme --load prhello.scm + + +install-example: build-example + sudo cp -a prhello-types.bin /usr/local/lib/mit-scheme/lib/. + sudo cp -a prhello-const.bin /usr/local/lib/mit-scheme/lib/. + sudo cp -a prhello-shim.so /usr/local/lib/mit-scheme/lib/. + +build-example: prhello-shim.so prhello-types.bin prhello-const.bin + +prhello-shim.so: prhello-shim.o + $(CC) -shared -fPIC -o $@ $^ `pkg-config --libs gtk+-2.0` + +prhello-shim.o: prhello-shim.c + $(CC) -I../lib -Wall -fPIC `pkg-config --cflags gtk+-2.0` -o $@ -c $< + +prhello-shim.c prhello-const.c prhello-types.bin: prhello.cdecl + (echo "(load-option 'FFI)"; \ + echo '(C-generate "prhello" "#include <gtk/gtk.h>")') \ + | mit-scheme --batch-mode + +prhello-const.bin: prhello-const.scm + echo '(sf "prhello-const")' | mit-scheme --compiler --batch-mode + +prhello-const.scm: prhello-const + ./prhello-const + +prhello-const: prhello-const.o + @rm -f $@ + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ `pkg-config --libs gtk+-2.0` + +prhello-const.o: prhello-const.c + $(CC) `pkg-config --cflags gtk+-2.0` $(CFLAGS) -o $@ -c $< + + |