I'm having troubles with my Makefile :-(
I have a mix of assembly and C sourcecode that I need to link together. I need different build-instructions for those two types. Since both the assembler and C compiler output *.o files, I cannot use the general %.o:%.c construction often found in example Makefiles
This what I'm trying now:
Get a list of all C files and their resulting output files:
C_SRCFILES := $(shell find $(SRCDIRS) -type -f -name "*.c") C_OBJFILES := $(patsub %.c,%.o,$(C_SRCFILES)) Get a list of all asm files and their resulting output files:
A_SRCFILES := $(shell find $(SRCDIRS) -type -f -name "*.asm") A_OBJFILES := $(patsub %.asm,%.o,$(A_SRCFILES)) When I echo those vars to the screen, they seem to be correct, but how I do define my targets now?
I tried something like this
$(A_OBJFILES): ($A_SRCFILES) $(AS) $(AFLAGS) -o $@ $* $(C_OBJFILES): ($C_SRCFILES) $(CC) $(CFLAGS) -c -o $@ $* all: $(A_OBJFILES) $(C_OBJFILES) $(LD) $(LDFLAGS) $(A_OBJFILES) $(C_OBJFILES) -o $(TARGET_OUTPUT) but ofcourse, this doesn't work...
Any suggestions?