OBJECTS_AARCH64 := $(patsubst $(SRC)/%.c, $(OBJECT_OUT)/%.aarch64.o, $(wildcard $(SRC)/*.c))

set-aarch64-toolchain:
	$(eval COMPILER=$(AARCH64_TOOLCHAIN)/aarch64-linux-gcc)
	$(eval STRIP=$(AARCH64_TOOLCHAIN)/aarch64-linux-strip)

make_aarch64: set-aarch64-toolchain compile_aarch64

compile_aarch64: $(OBJECTS_AARCH64)
	@echo $(TARGET).aarch64
	@$(COMPILER) -o $(OUT)/$(TARGET).aarch64 $(OBJECTS_AARCH64) $(GCC_FLAGS)
	@$(STRIP) $(OUT)/$(TARGET).aarch64 $(STRIP_FLAGS)
#	./anti_debug64 $(OUT)/$(TARGET).aarch64

$(OBJECTS_AARCH64): $(OBJECT_OUT)/%.aarch64.o: $(SRC)/%.c $(HEADERS)
	@$(COMPILER) -s -Os -c $< -o $@ -D ARCH=\"aarch64\" -D ARCH_LEN=7 $(CFLAGS) -I $(SRC)/headers

# Done.
