bug 447705 - fixinge makefile for js shell to handle parallel make invocations. r=crowder, not-part-of-the-build.
authorIgor Bukanov <igor@mir2.org>
Thu, 24 Jul 2008 11:03:19 +0200
changeset 16168 0fd114682f25e8b80596561503a069afad20c34a
parent 16167 2d36444242f231654401e6faffbf60a1c17ae698
child 16169 19565510d788834d1be31501f8b1c4d544865f03
push idunknown
push userunknown
push dateunknown
reviewerscrowder, not-part-of-the-build
bugs447705
milestone1.9.1a2pre
bug 447705 - fixinge makefile for js shell to handle parallel make invocations. r=crowder, not-part-of-the-build.
js/src/editline/Makefile.ref
--- a/js/src/editline/Makefile.ref
+++ b/js/src/editline/Makefile.ref
@@ -97,48 +97,44 @@ INCFILES = editline.h
 .INIT: $(INCFILES)
 .KEEP_STATE:
 EDITLINE_CFILES = editline.c sysunix.c
 
 EDITLINE_OBJS = $(addprefix $(OBJDIR)/, $(EDITLINE_CFILES:.c=.o))
 
 LIBRARY = $(OBJDIR)/libedit.a
 
-define MAKE_OBJDIR
-if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); fi
-endef
-
 all: $(LIBRARY) 
 
 export:
 
+$(EDITLINE_OBJS) : $(OBJDIR)
+
+$(OBJDIR) :
+	mkdir -p $@
+
 $(OBJDIR)/%: %.c
-	@$(MAKE_OBJDIR)
 	$(CC) -o $@ $(CFLAGS) $*.c $(LDFLAGS)
 
 $(OBJDIR)/%.o: %.c
-	@$(MAKE_OBJDIR)
 	$(CC) -o $@ -c $(CFLAGS) $*.c
 
 $(OBJDIR)/%.o: %.s
-	@$(MAKE_OBJDIR)
 	$(AS) -o $@ $(ASFLAGS) $*.s
 
 $(LIBRARY): $(EDITLINE_OBJS)
 	$(AR) rv $@ $?
 	$(RANLIB) $@
 
 #libedit.a : $(EDITLINE_OBJS) 
 #	$(AR) cru $(OBJDIR)/libedit.a $(EDITLINE_OBJS)
 #	$(RANLIB) $(OBJDIR)/libedit.a
 
 clean:
-	rm -rf $(EDITLINE_OBJS)
+	rm -rf $(EDITLINE_OBJS) $(EDITLINE_OBJS:.o=.d)
 
-clobber:
-	rm -rf $(EDITLINE_OBJS) $(LIBRARY) $(DEPENDENCIES)
+clobber: clean
+	rm -rf $(LIBRARY) $(DEPENDENCIES)
+	rmdir $(OBJDIR)
 
 SUFFIXES: .i
 %.i: %.c
 	$(CC) -C -E $(CFLAGS) $< > $*.i
-
-
-