From ae6e6c7f7a04a258e1b02a480901457fae0a8be7 Mon Sep 17 00:00:00 2001 From: Bartman/Abyss Date: Tue, 13 Feb 2024 21:42:30 +0100 Subject: [PATCH] Makefile: support dependency tracking for GNU-assembler sources (`.s`) --- CHANGELOG.md | 1 + template/Makefile | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aac55f5..190acacb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ See PR links for more information. ## 1.7.8 - FIX: disassembly: fix error message when hovering over the cycle counts of an illegal instruction +- NEW: Makefile: support dependency tracking for GNU-assembler sources (`.s`) ## 1.7.7 - FIX: Resource bitmap colors red & blue swapped [#226](https://github.com/BartmanAbyss/vscode-amiga-debug/issues/226) diff --git a/template/Makefile b/template/Makefile index 0a94b87d..3da59533 100644 --- a/template/Makefile +++ b/template/Makefile @@ -25,6 +25,7 @@ objects := $(cpp_objects) $(c_objects) $(s_objects) $(vasm_objects) program = out/a OUT = $(program) CC = m68k-amiga-elf-gcc +AS = m68k-amiga-elf-as VASM = vasmm68k_mot ifdef WINDOWS @@ -33,10 +34,10 @@ else SDKDIR = $(abspath $(dir $(shell which $(CC)))../m68k-amiga-elf/sys-include) endif -CCFLAGS = -g -MP -MMD -m68000 -Ofast -nostdlib -Wextra -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions -ffunction-sections -fdata-sections -CPPFLAGS= $(CCFLAGS) -fno-rtti -fcoroutines -fno-use-cxa-atexit -ASFLAGS = -Wa,-g,--register-prefix-optional,-I$(SDKDIR),-D -LDFLAGS = -Wl,--emit-relocs,--gc-sections,-Ttext=0,-Map=$(OUT).map +CCFLAGS = -g -MP -MMD -m68000 -Ofast -nostdlib -Wextra -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions -ffunction-sections -fdata-sections +CPPFLAGS = $(CCFLAGS) -fno-rtti -fcoroutines -fno-use-cxa-atexit +ASFLAGS = -mcpu=68000 -g --register-prefix-optional -I$(SDKDIR) +LDFLAGS = -Wl,--emit-relocs,--gc-sections,-Ttext=0,-Map=$(OUT).map VASMFLAGS = -m68000 -Felf -opt-fconst -nowarn=62 -dwarf=3 -quiet -x -I. -I$(SDKDIR) all: $(OUT).exe @@ -70,7 +71,7 @@ $(c_objects) : obj/%.o : %.c $(s_objects): obj/%.o : %.s $(info Assembling $<) - @$(CC) $(CCFLAGS) $(ASFLAGS) -c -o $@ $(CURDIR)/$< + @$(AS) $(ASFLAGS) --MD $(@D)/$*.d -o $@ $(CURDIR)/$< $(vasm_objects): obj/%.o : %.asm $(info Assembling $<)