Line 58... |
Line 58... |
SED := sed
|
SED := sed
|
OBJDUMP := $(CROSS)-objdump
|
OBJDUMP := $(CROSS)-objdump
|
|
|
# Not for build, for for building tags and dependency files, we need to know
|
# Not for build, for for building tags and dependency files, we need to know
|
# what the sources and headers are
|
# what the sources and headers are
|
SOURCES:= helloworld.c doorbell.c
|
DEVDRVR:= keypad.c display.c rtcsim.c
|
|
SOURCES:= helloworld.c doorbell.c doorbell2.c $(DEVDRVR)
|
HEADERS:= board.h
|
HEADERS:= board.h
|
# OBJECTS:= $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
|
# OBJECTS:= $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
|
|
OBJDRVR := $(addprefix $(OBJDIR)/,$(subst .c,.o,$(DEVDRVR)))
|
|
|
|
|
CPPFLAGS := -I../zipos -I.
|
CPPFLAGS := -I../zipos -I.
|
CFLAGS := -O3 -Wall -Wextra -nostdlib -fno-builtin
|
CFLAGS := -O3 -Wall -Wextra -nostdlib -fno-builtin
|
LDFLAGS = -T cmod.ld -Wl,-Map,$(OBJDIR)/$@.map -Wl,--unresolved-symbols=report-all -nostdlib
|
LDFLAGS = -T cmod.ld -Wl,-Map,$(OBJDIR)/$@.map -Wl,--unresolved-symbols=report-all -nostdlib
|
Line 87... |
Line 89... |
helloworld: $(OBJDIR)/ $(OBJDIR)/helloworld.o cmod.ld
|
helloworld: $(OBJDIR)/ $(OBJDIR)/helloworld.o cmod.ld
|
$(CC) $(LDFLAGS) $(OBJDIR)/helloworld.o -o $@
|
$(CC) $(LDFLAGS) $(OBJDIR)/helloworld.o -o $@
|
$(OBJDIR)/helloworld.txt: helloworld
|
$(OBJDIR)/helloworld.txt: helloworld
|
$(OBJDUMP) -dr $^ > $@
|
$(OBJDUMP) -dr $^ > $@
|
|
|
|
doorbell2: $(OBJDIR)/ $(OBJDIR)/doorbell2.o $(OBJDRVR) cmod.ld
|
|
$(CC) $(LDFLAGS) $(OBJDIR)/doorbell2.o $(OBJDRVR) -o $@
|
|
$(OBJDIR)/doorbell2.txt: doorbell2
|
|
$(OBJDUMP) -dr $^ > $@
|
|
|
define build-depends
|
define build-depends
|
@echo "Building dependency file(s)"
|
@echo "Building dependency file(s)"
|
$(CC) $(CPPFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdep.txt
|
$(CC) $(CPPFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdep.txt
|
$(SED) -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdep.txt > $(OBJDIR)/depends.txt
|
$(SED) -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdep.txt > $(OBJDIR)/depends.txt
|
@rm $(OBJDIR)/xdep.txt
|
@rm $(OBJDIR)/xdep.txt
|