Line 29... |
Line 29... |
##
|
##
|
################################################################################
|
################################################################################
|
##
|
##
|
##
|
##
|
.PHONY: all
|
.PHONY: all
|
PROGRAMS := exstartup oledtest gpsdump exmulti cputest
|
PROGRAMS := exstartup oledtest gpsdump exmulti cputest # hello
|
all: $(PROGRAMS)
|
all: $(PROGRAMS)
|
OBJDIR := obj-zip
|
OBJDIR := obj-zip
|
|
NM := zip-nm
|
|
RDELF := zip-readelf
|
CC := zip-gcc
|
CC := zip-gcc
|
OBJDUMP := zip-objdump
|
OBJDUMP := zip-objdump
|
SOURCES := exstartup.c bootloader.c gpsdump.c oledtest.c exmulti.c
|
SOURCES := exstartup.c bootloader.c gpsdump.c oledtest.c exmulti.c # hello.c
|
HEADERS := artyboard.h zipsys.h
|
HEADERS := artyboard.h zipsys.h
|
DUMPRTL := -fdump-rtl-all
|
DUMPRTL := -fdump-rtl-all
|
DUMPTREE:= -fdump-tree-all
|
DUMPTREE:= -fdump-tree-all
|
#
|
#
|
# For source analysis, the following macros are defined:
|
# For source analysis, the following macros are defined:
|
Line 48... |
Line 50... |
%.o: $(OBJDIR)/%.o
|
%.o: $(OBJDIR)/%.o
|
$(OBJDIR)/%.o: %.c
|
$(OBJDIR)/%.o: %.c
|
$(CC) -O3 -c -fno-builtin $< -o $@
|
$(CC) -O3 -c -fno-builtin $< -o $@
|
$(OBJDIR)/%.s: %.c
|
$(OBJDIR)/%.s: %.c
|
$(CC) -O3 -S -fno-builtin $< -o $@
|
$(CC) -O3 -S -fno-builtin $< -o $@
|
|
$(OBJDIR)/%.txt: $(OBJDIR)/%.o
|
|
bash -c "$(RDELF) -a $^ ; $(OBJDUMP) -S -D $^ " | tee $@
|
%.txt: %
|
%.txt: %
|
$(OBJDUMP) -S -D $^ > $@
|
$(OBJDUMP) -S -D $^ > $@
|
|
|
exstartup: exstartup.c artyboard.h zipsys.h arty.ld
|
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=exstartup.map exstartup.c -o exstartup
|
|
gpsdump: $(OBJDIR)/gpsdump.o $(OBJDIR)/bootloader.o arty.ld
|
exstartup: $(OBJDIR)/exstartup.o $(OBJDIR)/bootloader.o arty.ld
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=gpsdump.map $(OBJDIR)/gpsdump.o $(OBJDIR)/bootloader.o -o $@
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=exstartup.map $(OBJDIR)/exstartup.o $(OBJDIR)/bootloader.o -o exstartup
|
oledtest: $(OBJDIR)/oledtest.o $(OBJDIR)/bootloader.o $(OBJDIR)/splash.o $(OBJDIR)/mug.o arty.ld
|
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=oledtest.map $(OBJDIR)/oledtest.o $(OBJDIR)/bootloader.o $(OBJDIR)/splash.o $(OBJDIR)/mug.o -o $@
|
|
|
|
exmulti: $(OBJDIR)/exmulti.o $(OBJDIR)/bootloader.o arty.ld
|
exmulti: $(OBJDIR)/exmulti.o $(OBJDIR)/bootloader.o arty.ld
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=exmulti.map $(OBJDIR)/exmulti.o $(OBJDIR)/bootloader.o -o $@
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=exmulti.map $(OBJDIR)/exmulti.o $(OBJDIR)/bootloader.o -o $@
|
|
|
|
gpsdump: $(OBJDIR)/gpsdump.o $(OBJDIR)/bootloader.o arty.ld
|
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=gpsdump.map $(OBJDIR)/bootloader.o $(OBJDIR)/gpsdump.o -o $@
|
|
|
|
hello: $(OBJDIR)/hello.o $(OBJDIR)/bootloader.o arty.ld
|
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=hello.map $(OBJDIR)/bootloader.o $(OBJDIR)/hello.o -o $@
|
|
|
|
oledtest: $(OBJDIR)/oledtest.o $(OBJDIR)/bootloader.o $(OBJDIR)/splash.o $(OBJDIR)/mug.o arty.ld
|
|
$(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=oledtest.map $(OBJDIR)/oledtest.o $(OBJDIR)/bootloader.o $(OBJDIR)/splash.o $(OBJDIR)/mug.o -o $@
|
|
|
cputest: $(OBJDIR)/cputest.o artyram.ld
|
cputest: $(OBJDIR)/cputest.o artyram.ld
|
$(CC) -O3 -T artyram.ld -fno-builtin -Wl,-Map=cputest.map $(OBJDIR)/cputest.o -o $@
|
$(CC) -O3 -T artyram.ld -fno-builtin -Wl,-Map=cputest.map $(OBJDIR)/cputest.o -o $@
|
|
|
exstartup.txt: exstartup
|
exstartup.txt: exstartup
|
$(OBJDUMP) -S -D $^ > $@
|
$(OBJDUMP) -S -D $^ > $@
|
Line 85... |
Line 96... |
@ctags $(SOURCES) $(HEADERS)
|
@ctags $(SOURCES) $(HEADERS)
|
|
|
$(OBJDIR)/depends.txt: $(OBJDIR)/
|
$(OBJDIR)/depends.txt: $(OBJDIR)/
|
$(build-depends)
|
$(build-depends)
|
|
|
|
.PHONY: depends
|
|
depends:
|
|
$(build-depends)
|
|
|
$(OBJDIR)/:
|
$(OBJDIR)/:
|
@bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR)/; fi"
|
@bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR)/; fi"
|
|
|
-include $(OBJDIR)/depends.txt
|
-include $(OBJDIR)/depends.txt
|