diff --git a/runtime/Makefile b/runtime/Makefile new file mode 100644 index 000000000..1d5fe82a1 --- /dev/null +++ b/runtime/Makefile @@ -0,0 +1,31 @@ +UNAME_S := $(shell uname -s) + +ifeq ($(UNAME_S),Linux) + CC=gcc +else ifeq ($(UNAME_S),Darwin) + CC=clang + ARCH = -arch x86_64 +endif + +DISABLE_WARNINGS=-Wno-shift-negative-value +COMMON_FLAGS=$(DISABLE_WARNINGS) -g -fstack-protector-all $(ARCH) --std=c11 +PROD_FLAGS=$(COMMON_FLAGS) -DLAMA_ENV +TEST_FLAGS=$(COMMON_FLAGS) -DDEBUG_VERSION +UNIT_TESTS_FLAGS=$(TEST_FLAGS) +INVARIANTS_CHECK_FLAGS=$(TEST_FLAGS) -DFULL_INVARIANT_CHECKS + +all: gc.o runtime.o printf.o + ar rc runtime.a runtime.o gc.o printf.o + +gc.o: gc.c gc.h + $(CC) $(PROD_FLAGS) -c gc.c -o gc.o + +runtime.o: runtime.c runtime.h + $(CC) $(PROD_FLAGS) -c runtime.c -o runtime.o + +printf.o: printf.S + $(CC) $(PROD_FLAGS) -x assembler-with-cpp -c -g printf.S -o printf.o + +clean: + $(RM) *.a *.o *~ negative_scenarios/*.err + diff --git a/runtime32/Makefile b/runtime32/Makefile new file mode 100644 index 000000000..7c48b70fa --- /dev/null +++ b/runtime32/Makefile @@ -0,0 +1,15 @@ +RUNTIME=runtime.a + +.DEFAULT := $(RUNTIME) + +$(RUNTIME): gc_runtime.o runtime.o + ar rc $@ gc_runtime.o runtime.o + +gc_runtime.o: gc_runtime.s + $(CC) -g -fstack-protector-all -m32 -c gc_runtime.s + +runtime.o: runtime.c runtime.h + $(CC) -g -fstack-protector-all -m32 -c runtime.c + +clean: + $(RM) *.a *.o *~