I am working with Debian and gcc.
I have a single C file main.c, with some code in it.
For this trivial build, I am using the following Makefile:
Code:
SOURCES=main.c CFLAGS=-c -w -gdwarf-4 -g3 -O0 LDFLAGS= CC= OBJECTS=$(SOURCES:.c=.o) EXECUTABLE=myprogram all: clean $(SOURCES) $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) $(CC)gcc $(LDFLAGS) $(OBJECTS) -o $@ clean: rm -f $(EXECUTABLE) $(OBJECTS) $(MAKE) .c.o: $(CC)gcc $(CFLAGS) $(LDFLAGS) $< -o $@
Now, in main.c, I want to use an assembly function, say myFunction which is implemented in the file function.asm.
My question is now: how do I build this? How do I modify the Makefile above to do this ?
Many thanks for your help!!!
PD.