From 501cdacbe2105e18733610f9687d80a3ade56dba Mon Sep 17 00:00:00 2001 From: Magnus Myreen Date: Tue, 9 Aug 2022 23:10:23 +0200 Subject: [PATCH] Set __EVAL__ when compiling cake binary on Linux Also compile basis_ffi.c each time so that it is always compiled with or without __EVAL__ as needed. --- compiler/bootstrap/compilation/x64/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/bootstrap/compilation/x64/Makefile b/compiler/bootstrap/compilation/x64/Makefile index 9a607576f0..375c22cdd5 100644 --- a/compiler/bootstrap/compilation/x64/Makefile +++ b/compiler/bootstrap/compilation/x64/Makefile @@ -13,14 +13,17 @@ OS ?= $(shell uname) ifeq ($(OS),Windows_NT) PREF = SUFF = .exe + EVALFLAG = else PREF = ./ SUFF = + EVALFLAG = -D__EVAL__ endif ifeq ($(OS),Darwin) # These options avoid linker warnings on macOS LDFLAGS += -Wl,-no_pie + EVALFLAG = endif CMLS = $(wildcard *.cml) @@ -31,8 +34,8 @@ all: cake$(SUFF) # Linking the CakeML compiler -cake$(SUFF): cake.o basis_ffi.o - $(CC) $(LDFLAGS) $< basis_ffi.o $(LOADLIBES) $(LDLIBS) -o $@ +cake$(SUFF): cake.S basis_ffi.c + $(CC) $(LDFLAGS) $< basis_ffi.c $(LOADLIBES) $(LDLIBS) $(EVALFLAG) -o $@ # Note: While this Makefile is shared the sexpr files used in the example rules # below are only included in the verified cake-x64-64.tar.gz release package @@ -69,8 +72,8 @@ cake_riscv_host: cake-sexpr-64 basis_ffi.c cake$(SUFF) %.cake.S : %.cml cake$(SUFF) $(PREF)cake$(SUFF) $(CAKEFLAGS) <$< >$@ -%.cake$(SUFF) : %.cake.S basis_ffi.o - $(CC) $(LDFLAGS) $< basis_ffi.o $(LOADLIBES) $(LDLIBS) -o $@ +%.cake$(SUFF) : %.cake.S basis_ffi.c + $(CC) $(LDFLAGS) $< basis_ffi.c $(LOADLIBES) $(LDLIBS) -o $@ clean: $(RM) basis_ffi.o cake.o cake$(SUFF) *.cake.o *.cake.S *.cake$(SUFF)