Skip to content

Commit

Permalink
Pick back two runtime Makefiles
Browse files Browse the repository at this point in the history
Signed-off-by: Kakadu <Kakadu@pm.me>
  • Loading branch information
Kakadu committed Sep 5, 2024
1 parent 97074ff commit ff0e437
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
31 changes: 31 additions & 0 deletions runtime/Makefile
Original file line number Diff line number Diff line change
@@ -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

15 changes: 15 additions & 0 deletions runtime32/Makefile
Original file line number Diff line number Diff line change
@@ -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 *~

0 comments on commit ff0e437

Please sign in to comment.