1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
AUXDIR=/usr/local/lib/mit-scheme-i386
install: build
install -m 644 prhello-types.bin $(AUXDIR)
install -m 644 prhello-const.bin $(AUXDIR)
install -m 644 prhello-shim.so $(AUXDIR)
uninstall:
rm $(AUXDIR)/prhello-*
clean:
rm prhello-const* prhello-types* prhello-shim*
build: prhello-shim.so prhello-types.bin prhello-const.bin
prhello-shim.so: prhello-shim.o
$(CC) -shared -fPIC -o $@ $^ `pkg-config --libs gtk+-3.0`
prhello-shim.o: prhello-shim.c
$(CC) -I$(AUXDIR) -Wall -fPIC `pkg-config --cflags gtk+-3.0` -o $@ -c $<
prhello-shim.c prhello-const.c prhello-types.bin: prhello.cdecl
echo '(generate-shim "prhello" "#include <gtk/gtk.h>")' \
| mit-scheme --batch-mode
prhello-const.bin: prhello-const.scm
echo '(sf "prhello-const")' | mit-scheme --batch-mode
prhello-const.scm: prhello-const
./prhello-const
prhello-const: prhello-const.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) `pkg-config --libs gtk+-3.0`
prhello-const.o: prhello-const.c
$(CC) `pkg-config --cflags gtk+-3.0` $(CFLAGS) -o $@ -c $<
|