From 0de6fb1b12c8b91dff5ee3f6befb289023c4c0de Mon Sep 17 00:00:00 2001 From: Yacine Belkadi Date: Mon, 9 Jul 2012 10:07:14 +0200 Subject: cleo/{app,devkit/plcd}/Makefile: fix dependency on "obj" dir, refs #3255 The "obj" directory needs to be created before any "*.o" file. So "$(OBJPATH)" needs to be a prerequisite of the "$(OBJS)" target, instead of the final binary's target. By using the "|" of GNU Make, the "$(OBJPATH)" target is only made if "obj" doesn't exist, without considering the directory's timestamp. As a consequence, the "-p" option of "mkdir -p obj" is not necessary. --- cleopatre/application/libspid/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cleopatre/application/libspid') diff --git a/cleopatre/application/libspid/Makefile b/cleopatre/application/libspid/Makefile index 1271a9c7f6..a645c99d92 100644 --- a/cleopatre/application/libspid/Makefile +++ b/cleopatre/application/libspid/Makefile @@ -32,10 +32,10 @@ STAT_DEPS=$(patsubst %o,%d,$(STAT_OBJS)) all: $(STAT_LIB) $(DYN_LIB) -$(STAT_LIB): $(OBJPATH) $(STAT_OBJS) +$(STAT_LIB): $(STAT_OBJS) $(AR) cr $@ $(STAT_OBJS) -$(DYN_LIB): $(OBJPATH) $(DYN_OBJS) libmme +$(DYN_LIB): $(DYN_OBJS) libmme $(CC_WITHOUT_CFLAGS) -shared -fPIC $(LDOPTS) $(L_OPTS) $(LIBS) -o $@ $(DYN_OBJS) libmme: @@ -49,8 +49,10 @@ $(OBJPATH)/%.stat.o: $(SRCPATH)/%.c $(OBJPATH)/%.dyn.o: $(SRCPATH)/%.c $(CC_WITH_CFLAGS) $(INCLUDES) -fPIC -o $@ -c $< +$(DYN_OBJS) $(STAT_OBJS): | $(OBJPATH) + $(OBJPATH): - mkdir -p $(OBJPATH) + mkdir $(OBJPATH) -include $(STAT_DEPS) $(DYN_DEPS) -- cgit v1.2.3