Compile using static lib

This commit is contained in:
Justin Ethier 2015-03-30 13:56:46 -04:00
parent dd8b1852f7
commit dd4e8ebc94

View file

@ -13,7 +13,7 @@ parser.so: parser.scm
csc -s parser.scm csc -s parser.scm
libcyclone.a: runtime.c runtime.h libcyclone.a: runtime.c runtime.h
gcc -c runtime.c -o runtime.o gcc -g -c runtime.c -o runtime.o
ar rcs libcyclone.a runtime.o ar rcs libcyclone.a runtime.o
# Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html # Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
# Note compiler will have to link to this, eg: # Note compiler will have to link to this, eg:
@ -21,6 +21,11 @@ libcyclone.a: runtime.c runtime.h
#gcc -static main.c -L. -lmean -o statically_linked #gcc -static main.c -L. -lmean -o statically_linked
#Note: the first three letters (the lib) must not be specified, as well as the suffix (.a) #Note: the first three letters (the lib) must not be specified, as well as the suffix (.a)
# debug compilation using static lib
.PHONY: debug
debug:
gcc -static test.c -L. -lcyclone -I. -g -o test
cyclone: cyclone.scm trans.so cgen.so parser.so libcyclone.a cyclone: cyclone.scm trans.so cgen.so parser.so libcyclone.a
csc cyclone.scm csc cyclone.scm