aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-06-25 12:09:26 +0100
committerKimplul <kimi.h.kuparinen@gmail.com>2023-06-25 12:09:26 +0100
commitc8ebd81dfc4b8f4c1d488202d0962ac85e977b51 (patch)
tree4265b796348e8fdea95ceb4484398145231d2038 /Makefile
parent4a522e044886ed140cbf31f48e797edbd01cc9eb (diff)
downloadcopyjit-c8ebd81dfc4b8f4c1d488202d0962ac85e977b51.tar.gz
copyjit-c8ebd81dfc4b8f4c1d488202d0962ac85e977b51.zip
move over to linker based jumps
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2a19ddd..2029aac 100644
--- a/Makefile
+++ b/Makefile
@@ -26,9 +26,20 @@ include src/source.mk
COMPILE = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS)\
$(CFLAGS) $(DEPFLAGS) $(COMPILEFLAGS) $(INCLUDEFLAGS)
-OP_COMPILE = $(CROSS_COMPILE)$(CC) \
+OP_COMPILE := $(CROSS_COMPILE)$(CC) \
-Wall -Wextra -O2 \
- -fno-schedule-insns -fno-schedule-insns2
+ -fno-schedule-insns -fno-schedule-insns2 \
+ -fpic -fpie \
+ -T lib/link.ld \
+ -ffreestanding \
+ -nostdlib
+
+# load arch specific compilation options
+# as much as I'd like to have everything be completely generic,
+# it seems that some arch specific memory models generate unsuitable code
+# so we have to specify which models we want to use.
+ARCH != uname -m
+-include arch/$(ARCH).mk
LINT = $(COMPILE) $(LINTFLAGS)
@@ -66,7 +77,7 @@ copyjit: $(OBJS)
# could probably make this a bit prettier
.PHONY: clean
clean:
- @$(RM) -r build copyjit lib/gen/* lib/*.o lib/*.bin lib/*.d lib/prune deps.mk
+ @$(RM) -r build copyjit lib/gen/* lib/*.bin lib/*.d lib/empty lib/prune deps.mk
.PHONY: clean_docs
clean_docs: