Commit e7b914aa authored by Gaurav Kukreja's avatar Gaurav Kukreja

Modified Makefile for simple to generate objdump from IR code

Signed-off-by: Gaurav Kukreja's avatarGaurav Kukreja <gaurav@gauravk.in>
parent 8be1f226
# Makefile to compile the C Example code # Makefile to compile the C Example code
# make all - generates the debug information, and binary code for all the # make all - generates the debug information, and binary code for all the
# examples in the folder. # examples in the folder.
include ../../Makefile.macros
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing
...@@ -9,22 +10,22 @@ IRDUMP = 1 #defined - dump IR files, undefined - don't. ...@@ -9,22 +10,22 @@ IRDUMP = 1 #defined - dump IR files, undefined - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point #PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
ifdef PHASE ifdef PHASE
CC = arm-none-linux-gnueabi-gcc CC = $(CROSS_GCC)
OBJDUMP = arm-none-linux-gnueabi-objdump OBJDUMP = $(CROSS_OBJDUMP)
OEXT = elf OEXT = elf
ifdef IRDUMP ifdef IRDUMP
COPTS = -static ${OPT} ${TREEDUMP} COPTS = -static ${OPT} ${TREEDUMP} -T generic-hosted.ld
else else
COPTS = -static ${OPT} COPTS = -static ${OPT} -T generic-hosted.ld
endif endif
ifdef PRINT ifdef PRINT
COPTS += -msoft-float COPTS += -msoft-float
endif endif
else else
CC = gcc CC = $(GCC)
OBJDUMP = objdump OBJDUMP = $(HOST_OBJDUMP)
OEXT = out OEXT = out
ifdef IRDUMP ifdef IRDUMP
...@@ -34,12 +35,17 @@ else ...@@ -34,12 +35,17 @@ else
endif endif
endif endif
all: simple APP1 = simple
all: simple.$(OEXT) simple.objdump
simple.$(OEXT): simple.c
$(CC) $(COPTS) -o $@ $^
simple: simple.c simple.objdump: simple.$(OEXT)
$(CC) $(COPTS) -o $@.$(OEXT) $^ ${OBJDUMP} -D $^ >& ${APP1}.objdump
test: test:
clean: clean:
rm -rf *.o *.c.* simple.elf simple.out rm -rf *.o *.c.* simple.elf simple.out simple.objdump
\ No newline at end of file
...@@ -15,9 +15,9 @@ ifdef PHASE ...@@ -15,9 +15,9 @@ ifdef PHASE
OEXT = elf OEXT = elf
ifdef IRDUMP ifdef IRDUMP
COPTS = -static ${OPT} ${TREEDUMP} COPTS = -static ${OPT} ${TREEDUMP} -T generic-hosted.ld
else else
COPTS = -static ${OPT} COPTS = -static ${OPT} -T generic-hosted.ld
endif endif
ifdef PRINT ifdef PRINT
...@@ -35,12 +35,18 @@ else ...@@ -35,12 +35,18 @@ else
endif endif
endif endif
all: simple_IR APP1 = simple_IR
all: simple_IR.$(OEXT) simple_IR.objdump
simple_IR.$(OEXT): simple_IR.c
$(CC) $(COPTS) -o $@ $^
simple_IR.objdump: simple_IR.$(OEXT)
${OBJDUMP} -D $^ >& ${APP1}.objdump
simple_IR: simple_IR.c
$(CC) $(COPTS) -o $@.$(OEXT) $^
test: test:
clean: clean:
rm -rf *.o *.c.* simple_IR.elf simple_IR.out rm -rf *.o *.c.* simple_IR.elf simple_IR.out simple_IR.objdump
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment