AnsweredAssumed Answered

makefile with separate flags for each file

Question asked by illishar on Aug 19, 2013
Latest reply on Aug 20, 2013 by illishar



I'm trying to compile a user space program, containing a tricky module.

I have a file called "my_module.asm". This is a ported VDSP file, hence the ASM name. I has to be named ASM to be able to work in VDSP I think.


To compile it you have to give the following command:

bfin-uclinux-gcc -x assembler-with-cpp my_module.asm -c


My makefile looks like this:


EXEC = modbus  
OBJS = main.o io.o Modbus.o ServerFunctions.o  
EXTRALIBS = -lpthread   

all: $(EXEC)  

$(EXEC): $(OBJS)  
          $(CC) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(LDLIBS)  

          $(ROMFSINST) /bin/$(EXEC)  
          $(ROMFSINST) -e CONFIG_USER_MODBUS -a "console:respawn:/bin/$(EXEC)" /etc/inittab  

          -rm -f $(EXEC) *.elf *.elf2flt *.gdb *.o  


How do I single out a specific file, give it a special compiler and special flags?




PS. This won't work:

OBJS = main.o io.o Modbus.o ServerFunctions.o my_module.o