1.test.scm
;;1.declare include
(c-declare #<<c-declare-end
#include <stdio.h>
c-declare-end
)
;;2.implement
(define test
(c-lambda () void
#<<c-code-end
printf("Hello scheme.\n");
c-code-end
))
;;eval
(test)
2.编译:
CC = gsc -exe
TARGET = test
all:$(TARGET)
$(TARGET):
$(CC) test.scm
.PHONY:clean
clean:
rm -f $(TARGET)