Richard Payne
asked on
GCC Makefile, how to generate lst or lss with c code embedded to lst.
Here the attached makefile where I have simple makefile template (part of learning with multiple h and c code)
========================== ========== ========== ========== =
# ------------- SOURCE FILE ------------------------
OBJECTS = main.o runme.o
#OBJECTS = main.c runme.c
#--------------TARGETS EXE -------------------------
TARGET = go
#--------------Folder Path---------------------- ----
vpath %.c src
vpath %.h include
vpath %.o obj
# ------------- COMPILER OPTIONS -------------------
CFLAGS=-ggdb -Wall -std=c99 -I include
CC=gcc
# ------------- TARGETS -------------------------- --
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(CFLAGS) -o $(TARGET)
# ------------- CLEAN UP -------------------------- --
.PHONY: clean
clean:
rm -f *.o *.out
# -------------- DEPENDENCIES ---------------------
runme.o: runme.h
main.o: main.h runme.h
========================== ========== ========== =========
I need to embedded asm with code via lst or lss or s. I do not know how to add option to make it work as I tried several time
(a) what the difference between lst, lss and s
(b) What modification to provides txt files with asm with embedded c code
(c) I need to put .o code into object folder, how
Thanks
I'm using cygwin for training purpose and then work on UNIX (linix server). It use GNU toolchain.
==========================
# ------------- SOURCE FILE ------------------------
OBJECTS = main.o runme.o
#OBJECTS = main.c runme.c
#--------------TARGETS EXE -------------------------
TARGET = go
#--------------Folder Path----------------------
vpath %.c src
vpath %.h include
vpath %.o obj
# ------------- COMPILER OPTIONS -------------------
CFLAGS=-ggdb -Wall -std=c99 -I include
CC=gcc
# ------------- TARGETS --------------------------
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(CFLAGS) -o $(TARGET)
# ------------- CLEAN UP --------------------------
.PHONY: clean
clean:
rm -f *.o *.out
# -------------- DEPENDENCIES ---------------------
runme.o: runme.h
main.o: main.h runme.h
==========================
I need to embedded asm with code via lst or lss or s. I do not know how to add option to make it work as I tried several time
(a) what the difference between lst, lss and s
(b) What modification to provides txt files with asm with embedded c code
(c) I need to put .o code into object folder, how
Thanks
I'm using cygwin for training purpose and then work on UNIX (linix server). It use GNU toolchain.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER