From 1e6ca529aa29a2a0aa93d94d044c2944a689ebc3 Mon Sep 17 00:00:00 2001 From: mazze Date: Sat, 6 Sep 2014 19:10:25 +0000 Subject: [PATCH] flexcat: use the same method for getting the dependencies as the original Makefile. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@49580 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- Makefile.in | 2 +- tools/flexcat/src/Makefile.aros | 54 +++++++++++++++++++++++------------------ 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/Makefile.in b/Makefile.in index b94d2e306a..13580725c2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -147,7 +147,7 @@ $(MMAKE): $(TOP)/tools/MetaMake/Makefile $(wildcard $(SRCDIR)/tools/MetaMake/*.[ clean: @+$(CALL) $(MMAKE) $(MMAKE_OPTIONS) AROS.clean @$(MAKE) $(MKARGS) -C $(TOP)/tools/MetaMake clean SRCDIR=$(SRCDIR) TOP=$(TOP) - @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/flexcat -f Makefile.aros clean SRCDIR=$(SRCDIR) TOP=$(TOP) + @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/flexcat/src -f Makefile.aros clean SRCDIR=$(SRCDIR) TOP=$(TOP) @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/archtools clean SRCDIR=$(SRCDIR) TOP=$(TOP) @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/genmf clean @$(CALL) $(MAKE) $(MKARGS) -C $(SRCDIR)/tools/toollib clean SRCDIR=$(SRCDIR) TOP=$(TOP) diff --git a/tools/flexcat/src/Makefile.aros b/tools/flexcat/src/Makefile.aros index 9e14f8983b..0172c2909c 100644 --- a/tools/flexcat/src/Makefile.aros +++ b/tools/flexcat/src/Makefile.aros @@ -8,40 +8,48 @@ include $(TOP)/config/make.cfg USER_CFLAGS := -Wall -Werror -Wunused -O2 -SRC := main.c \ - asprintf.c \ - strptime.c \ - createcat.c \ - createcatsrc.c \ - createct.c \ - globals.c \ - readprefs.c \ - scancd.c \ - scanct.c \ - scanpo.c \ - showfuncs.c \ - swapfuncs.c \ - utils.c \ - locale_other.c +OBJS := main.o \ + asprintf.o \ + strptime.o \ + createcat.o \ + createcatsrc.o \ + createct.o \ + globals.o \ + readprefs.o \ + scancd.o \ + scanct.o \ + scanpo.o \ + showfuncs.o \ + swapfuncs.o \ + utils.o \ + locale_other.o + +OBJDIR := $(HOSTGENDIR)/tools/flexcat SDFILES := C_h_aros.sd C_c_orig.sd C_h_orig.sd gcccatcomp.sd - SD_OUT := $(foreach f,$(SDFILES),$(TOOLDIR)/$(f)) -all : $(FLEXCAT) $(SD_OUT) +.PHONY: all +all: $(OBJDIR) $(FLEXCAT) $(SD_OUT) -$(FLEXCAT) : $(SRC) - @$(MECHO) "Compiling $(notdir $@)..." - @$(HOST_CC) -DNOERRORONWARN $(HOST_CFLAGS) $(HOST_LDFLAGS) $(SRC) -o $@ +$(FLEXCAT) : $(addprefix $(OBJDIR)/,$(OBJS)) + @$(ECHO) "Linking $(notdir $@)..." + @$(HOST_CC) $(HOST_LDFLAGS) $^ -o $@ # @$(HOST_STRIP) $@ +$(OBJDIR)/%.o : %.c + @$(ECHO) "Compiling flexcat/src/$(notdir $@)..." + @$(HOST_CC) -MM -MP -MT '$@' -MF $(OBJDIR)/$(subst .c,.d,$<) $(HOST_CFLAGS) $< + @$(HOST_CC) -DNOERRORONWARN $(HOST_CFLAGS) -o $@ -c $< + $(TOOLDIR)/%.sd : sd/%.sd @$(CP) $< $@ - - $(OBJDIR) : @$(MKDIR) -p $(OBJDIR) +.PHONY: clean clean: - @$(RM) -f $(FLEXCAT) + @$(RM) -rf $(OBJDIR) $(FLEXCAT) + +-include $(OBJS:%.o=$(OBJDIR)/%.d) -- 2.11.4.GIT