diff options
Diffstat (limited to 'nuttx/arch')
-rw-r--r-- | nuttx/arch/arm/src/Makefile | 10 | ||||
-rw-r--r-- | nuttx/arch/c5471/src/Makefile | 9 | ||||
-rw-r--r-- | nuttx/arch/dm320/src/Makefile | 9 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/src/Makefile | 17 | ||||
-rw-r--r-- | nuttx/arch/sim/src/Makefile | 10 | ||||
-rw-r--r-- | nuttx/arch/z16/src/Makefile | 12 | ||||
-rw-r--r-- | nuttx/arch/z80/src/Makefile | 15 |
7 files changed, 42 insertions, 40 deletions
diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile index d3347c23c..445577b4a 100644 --- a/nuttx/arch/arm/src/Makefile +++ b/nuttx/arch/arm/src/Makefile @@ -66,22 +66,22 @@ VPATH = chip:common all: $(HEAD_OBJ) libarch$(LIBEXT) $(AOBJS) $(HEAD_AOBJ): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libarch$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) board/libboard$(LIBEXT): $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) nuttx: $(HEAD_AOBJ) board/libboard$(LIBEXT) - $(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \ + @echo "LD: nuttx" + @$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \ --start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC) @$(NM) $(TOPDIR)/$@ | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ diff --git a/nuttx/arch/c5471/src/Makefile b/nuttx/arch/c5471/src/Makefile index 809032854..c04d9a9a6 100644 --- a/nuttx/arch/c5471/src/Makefile +++ b/nuttx/arch/c5471/src/Makefile @@ -71,15 +71,14 @@ LIBGCC = ${shell $(CC) -print-libgcc-file-name} all: up_head.o libarch$(LIBEXT) $(AOBJS) $(LINKOBJS): %.o: %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS): %.o: %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libarch$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) board/libboard$(LIBEXT): @@ -114,7 +113,7 @@ clean: @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ fi - rm -f libarch$(LIBEXT) *.o *~ + rm -f libarch$(LIBEXT) *.o *.obj *~ distclean: clean @if [ -e board/Makefile ]; then \ diff --git a/nuttx/arch/dm320/src/Makefile b/nuttx/arch/dm320/src/Makefile index 8c031185a..41b9a90ab 100644 --- a/nuttx/arch/dm320/src/Makefile +++ b/nuttx/arch/dm320/src/Makefile @@ -69,15 +69,14 @@ LIBGCC = ${shell $(CC) -print-libgcc-file-name} all: up_head.o libarch$(LIBEXT) $(AOBJS) $(LINKOBJS): %.o: %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS): %.o: %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libarch$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) board/libboard$(LIBEXT): @@ -114,7 +113,7 @@ clean: @if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ fi - rm -f libarch$(LIBEXT) *.o *~ + rm -f libarch$(LIBEXT) *.o *.obj *~ distclean: clean @if [ -e board/Makefile ]; then \ diff --git a/nuttx/arch/pjrc-8051/src/Makefile b/nuttx/arch/pjrc-8051/src/Makefile index 3cd07406b..5d95b2f78 100644 --- a/nuttx/arch/pjrc-8051/src/Makefile +++ b/nuttx/arch/pjrc-8051/src/Makefile @@ -108,13 +108,13 @@ STACK_BASE = ${shell \ all: up_head$(OBJEXT) libarch$(LIBEXT) $(ASRCS) $(LINKASRCS): %$(ASMEXT): %.S - $(CPP) -P $(CPPFLAGS) -D__ASSEMBLY__ $< -o $@ + $(CPP) -P $(CPPFLAGS) $< -o $@ $(AOBJS) $(LINKOBJS): $(ASRCS) $(LINKASRCS) - $(AS) $(ASFLAGS) $< + $(call ASSEMBLE, $<, $@) $(COBJS) $(TESTOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) # Create a header file that contains addressing information needed by the code @@ -147,8 +147,7 @@ up_mem.h: pass1.mem libarch$(LIBEXT): up_mem.h $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $${obj} FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) # This is a kludge to work around some conflicting symbols in libsdcc.liXqueb @@ -171,19 +170,21 @@ board/libboard$(LIBEXT): # This target builds the final executable pass1.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT) - $(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ + @echo "LD: $@" + @$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ @rm -f up_mem.h @rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT) @$(MAKE) TOPDIR=$(TOPDIR) libarch$(LIBEXT) nuttx.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) - $(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ + @echo "LD: $@" + @$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ nuttx$(EXEEXT): pass1.ihx nuttx.ihx @rm -f pass1.* - packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT) + @packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT) @cp -f nuttx.map $(TOPDIR)/. # This target builds a test program to verify interrupt context switching. irqtest is diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile index 83da1d411..61e4d85d5 100644 --- a/nuttx/arch/sim/src/Makefile +++ b/nuttx/arch/sim/src/Makefile @@ -73,22 +73,22 @@ LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS)))) all: up_head$(OBJEXT) libarch$(LIBEXT) $(AOBJS): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) $(SPECOBJS): %$(OBJEXT): %.c $(CC) -c $(HOSTCFLAGS) $< -o $@ libarch$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) nuttx$(EXEEXT): $(LINKOBJS) - $(CC) $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \ + @echo "LD: nuttx$(EXEEXT)" + @$(CC) $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \ -Wl,--start-group $(LDLIBS) -Wl,--end-group $(EXTRA_LIBS) @$(NM) $(TOPDIR)/$@ | \ grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ diff --git a/nuttx/arch/z16/src/Makefile b/nuttx/arch/z16/src/Makefile index 487257dda..b1eee8ebe 100644 --- a/nuttx/arch/z16/src/Makefile +++ b/nuttx/arch/z16/src/Makefile @@ -37,7 +37,10 @@ -include chip/Make.defs ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src -CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +USRINCLUDES = -userinc:".;$(TOPDIR)/sched;$(ARCH_SRCDIR)/chip;$(ARCH_SRCDIR)/common" +INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) HEAD_AOBJ = $(HEAD_ASRC:.S=$(OBJEXT)) @@ -66,15 +69,14 @@ VPATH = chip:common all: $(HEAD_OBJ) libarch$(LIBEXT) $(AOBJS) $(HEAD_AOBJ): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libarch$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) board/libboard$(LIBEXT): diff --git a/nuttx/arch/z80/src/Makefile b/nuttx/arch/z80/src/Makefile index b224a86d5..2c1f15c99 100644 --- a/nuttx/arch/z80/src/Makefile +++ b/nuttx/arch/z80/src/Makefile @@ -114,10 +114,10 @@ HEAP_BASE = ${shell \ all: $(HEAD_AOBJ) libarch$(LIBEXT) $(AOBJS) $(HEAD_AOBJ): %$(OBJEXT): %$(ASMEXT) - $(AS) $(ASFLAGS) $@ $< + $(call ASSEMBLE, $<, $@) $(COBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) # This is a kludge to work around some conflicting symbols in libsdcc.liXqueb @@ -158,8 +158,7 @@ endif libarch$(LIBEXT): up_mem.h asm_mem.h $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $${obj} FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) # This builds the libboard library in the board/ subdirectory @@ -170,6 +169,7 @@ board/libboard$(LIBEXT): # This target builds the final executable pass1.ihx: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_AOBJ) board/libboard$(LIBEXT) + @echo "LD: pass1.ihx" @echo "--" >pass1.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library @echo "-k $(SDCCLIBDIR)" >>pass1.lnk # Path to SDCC z80 library @@ -187,13 +187,14 @@ pass1.ihx: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_AOBJ) board/libboar @echo "pass1.ihx" >>pass1.lnk # Path to head object @echo "$(HEAD_AOBJ)" >>pass1.lnk # Path to head object @echo "-e" >>pass1.lnk # End of script - $(LD) -f pass1.lnk + @$(LD) -f pass1.lnk @rm -f up_mem.h asm_mem.h @rm -f up_allocateheap$(OBJEXT) $(HEAD_AOBJ) libarch$(LIBEXT) @$(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) @$(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_AOBJ) nuttx.ihx: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_AOBJ) board/libboard$(LIBEXT) + @echo "LD: nuttx.ihx" @echo "--" >nuttx.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library @echo "-k $(SDCCLIBDIR)" >>nuttx.lnk # Path to SDCC z80 library @@ -211,11 +212,11 @@ nuttx.ihx: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_AOBJ) board/libboar @echo "nuttx.ihx" >>nuttx.lnk # Path to head object @echo "$(HEAD_AOBJ)" >>nuttx.lnk # Path to head object @echo "-e" >>nuttx.lnk # End of script - $(LD) -f nuttx.lnk + @$(LD) -f nuttx.lnk nuttx$(EXEEXT): pass1.ihx nuttx.ihx @rm -f pass1.* - packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT) + @packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT) @cp -f nuttx.map $(TOPDIR)/. # Build dependencies |