summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2017-04-08 21:31:59 -0400
committerQuentin Carbonneaux <quentin@c9x.me>2017-04-08 22:09:55 -0400
commit61090c758d36f3919a222efe01c9794fdf7987ef (patch)
treeb7329a9a5ef93cff5d4a96daf0cfed0e4c8247dd /Makefile
parent96836855a55cd28f1449b4a58d1e5301669350c0 (diff)
downloadroux-61090c758d36f3919a222efe01c9794fdf7987ef.tar.gz
new arm64 backend, yeepee
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2433e25..6c0b429 100644
--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,12 @@ OBJDIR = obj
 SRC      = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c \
            fold.c live.c spill.c rega.c gas.c
 AMD64SRC = amd64/targ.c amd64/sysv.c amd64/isel.c amd64/emit.c
-SRCALL   = $(SRC) $(AMD64SRC)
+ARM64SRC = arm64/targ.c arm64/abi.c arm64/isel.c arm64/emit.c
+SRCALL   = $(SRC) $(AMD64SRC) $(ARM64SRC)
 
 AMD64OBJ = $(AMD64SRC:%.c=$(OBJDIR)/%.o)
-OBJ      = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ)
+ARM64OBJ = $(ARM64SRC:%.c=$(OBJDIR)/%.o)
+OBJ      = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) $(ARM64OBJ)
 
 CFLAGS += -Wall -Wextra -std=c99 -g -pedantic
 
@@ -24,10 +26,12 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/timestamp
 $(OBJDIR)/timestamp:
 	@mkdir -p $(OBJDIR)
 	@mkdir -p $(OBJDIR)/amd64
+	@mkdir -p $(OBJDIR)/arm64
 	@touch $@
 
 $(OBJ): all.h ops.h
 $(AMD64OBJ): amd64/all.h
+$(ARM64OBJ): arm64/all.h
 obj/main.o: config.h
 
 config.h:
@@ -38,7 +42,14 @@ config.h:
 		;;                                     \
 	*)                                             \
 		echo "#define Defasm Gaself";          \
-		echo "#define Deftgt T_amd64_sysv";    \
+		case `uname -m` in                     \
+		*aarch64*)                             \
+			echo "$define Deftgt T_arm64"; \
+			;;                             \
+		*)                                     \
+			echo "#define Deftgt T_amd64_sysv";\
+			;;                             \
+		esac                                   \
 		;;                                     \
 	esac > $@