fix: using the linker for generating a .o file is a feature for only GNU ld.

Now utilising a process to generate a .c file using `xxd`, and compiling
those to object files.
This commit is contained in:
2025-09-15 11:04:04 +02:00
parent 3a7709c392
commit f20171c0d7
3 changed files with 18 additions and 20 deletions

View File

@@ -72,10 +72,15 @@ bin/TEST_$(NAME): $(TOBJ) $(filter-out obj/src/main.o,$(OBJ))
@mkdir -p $(@D)
@$(LD) -o $@ $^ $(LDFLAGS) $(LDLIBS)
obj/res/%.o: res/%
$(info [LD] $@)
obj/res/%.c: res/%
$(info [XXD] $@)
@mkdir -p $(@D)
@$(LD) -r -b binary -o $@ $<
@xxd -i -n $(patsubst res/%,%,$<) $< $@
obj/res/%.o: obj/res/%.c
$(info [CC] $@)
@mkdir -p $(@D)
@$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
obj/%.o: %.c
$(info [CC] $@)