diff --git a/ChangeLog.txt b/ChangeLog.txt index 4c831693a..460bb5a8d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -720,3 +720,6 @@ options to the hexdump command. From Ken Pettit (2013-11-1). * apps/platrorm/mikroe-stm32f4: Now uses /dev/config for configuration data storage. From Ken Pettit (2013-11-1). + * apps/platform/Makefile: Was not dealing with the bin sub-directory + correctly (2013-11-2). + diff --git a/platform/.gitignore b/platform/.gitignore index 4847299eb..7c70d67ec 100644 --- a/platform/.gitignore +++ b/platform/.gitignore @@ -1,4 +1,5 @@ /.built -/Make.defs +/.depend +/Make.dep board diff --git a/platform/Makefile b/platform/Makefile index 73c1580b5..02b055b50 100644 --- a/platform/Makefile +++ b/platform/Makefile @@ -51,7 +51,6 @@ endif # Directories -BINDIR = $(APPDIR)$(DELIM)platform$(DELIM)bin PLATFORMDIR = $(APPDIR)$(DELIM)platform$(DELIM)board DUMMYDIR = $(APPDIR)$(DELIM)platform$(DELIM)dummy BOARDDIR = $(APPDIR)$(DELIM)platform$(DELIM)$(CONFIG_ARCH_BOARD) @@ -66,8 +65,8 @@ CSRCS = -include $(PLATFORMDIR)$(DELIM)Make.defs -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +AOBJS = $(patsubst %.S, bin$(DELIM)%$(OBJEXT), $(ASRCS)) +COBJS = $(patsubst %.c, bin$(DELIM)%$(OBJEXT), $(CSRCS)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) @@ -87,18 +86,18 @@ endif all: .built .PHONY: context .depend depend clean distclean -ifneq ($(AOBJS),) -$(AOBJS): %$(OBJEXT): %.S +ifneq ($(ASRCS),) +$(AOBJS): bin$(DELIM)%$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) endif -ifneq ($(COBJS),) -$(COBJS): %$(OBJEXT): %.c +ifneq ($(CSRCS),) +$(COBJS): bin$(DELIM)%$(OBJEXT): %.c $(call COMPILE, $<, $@) endif .built: $(OBJS) -ifneq ($(OBJS),) +ifneq ($(SRCS),) $(call ARCHIVE, $(BIN), $(OBJS)) endif $(Q) touch .built @@ -124,7 +123,7 @@ depend: .depend clean: $(PLATFORMDIR) $(call DELFILE, .built) - $(Q) $(MAKE) -C $(BINDIR) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" clean + $(Q) $(MAKE) -C bin TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" clean distclean: clean $(call DELFILE, Make.dep) diff --git a/platform/bin/.gitignore b/platform/bin/.gitignore new file mode 100644 index 000000000..e5cc00798 --- /dev/null +++ b/platform/bin/.gitignore @@ -0,0 +1,8 @@ +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.obj