Skip to content

Commit

Permalink
* Remove cleandeps target
Browse files Browse the repository at this point in the history
* Implement much nicer .d files, as suggested by Casey Carter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8020 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Aug 21, 2003
1 parent f3526e2 commit fbb574d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
16 changes: 6 additions & 10 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ prdirs::
# which are marked as Phony.
#
.PHONY: all dynamic bytecodelib bytecodelib-install
.PHONY: clean cleandeps distclean install test bytecode prdirs
.PHONY: clean distclean install test bytecode prdirs

###########################################################################
# Miscellaneous paths and commands:
Expand Down Expand Up @@ -438,7 +438,7 @@ RObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(RObjs))
#---------------------------------------------------------

ifdef DIRS
all install clean cleandeps test bytecode ::
all install clean test bytecode ::
$(VERB) for dir in ${DIRS}; do \
(cd $$dir; $(MAKE) $@) || exit 1; \
done
Expand All @@ -449,18 +449,16 @@ ifdef PARALLEL_DIRS
all :: $(addsuffix /.makeall , $(PARALLEL_DIRS))
install :: $(addsuffix /.makeinstall , $(PARALLEL_DIRS))
clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS))
cleandeps:: $(addsuffix /.makecleandeps, $(PARALLEL_DIRS))
test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS))

%/.makeall %/.makeinstall %/.makeclean %/.makecleandeps %/.maketest \
%/.makebytecode:
%/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode:
$(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
endif

# Handle directories that may or may not exist
ifdef OPTIONAL_DIRS
all install clean cleandeps test bytecode ::
all install clean test bytecode ::
$(VERB) for dir in ${OPTIONAL_DIRS}; do \
if [ -d $$dir ]; \
then\
Expand Down Expand Up @@ -821,28 +819,26 @@ SourceBaseNames := $(basename $(notdir $(filter-out Debug/%, $(Source))))
SourceDepend := $(SourceBaseNames:%=$(BUILD_OBJ_DIR)/Depend/%.d)

# Create dependencies for the *.cpp files...
#$(SourceDepend): \x
$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Depend/.dir
$(VERB) $(Depend) $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
$(VERB) $(Depend) $< | $(SED) 's|$*.o: $*.cpp||' | $(SED) 's|[^\]$$|&::|' >> $@

# Create dependencies for the *.c files...
#$(SourceDepend): \x
$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Depend/.dir
$(VERB) $(DependC) -o $@ $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
$(VERB) $(Depend) $< | $(SED) 's|$*.o: $*.c||' | $(SED) 's|[^\]$$|&::|' >> $@

#
# Include dependencies generated from C/C++ source files, but not if we
# are cleaning (this example taken from the GNU Make Manual).
#
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(MAKECMDGOALS),cleandeps)
ifneq ($(SourceDepend),)
-include $(SourceDepend)
endif
endif
endif
endif

cleandeps::
$(VERB) rm -f $(SourceDepend)
Expand Down
16 changes: 6 additions & 10 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ prdirs::
# which are marked as Phony.
#
.PHONY: all dynamic bytecodelib bytecodelib-install
.PHONY: clean cleandeps distclean install test bytecode prdirs
.PHONY: clean distclean install test bytecode prdirs

###########################################################################
# Miscellaneous paths and commands:
Expand Down Expand Up @@ -438,7 +438,7 @@ RObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(RObjs))
#---------------------------------------------------------

ifdef DIRS
all install clean cleandeps test bytecode ::
all install clean test bytecode ::
$(VERB) for dir in ${DIRS}; do \
(cd $$dir; $(MAKE) $@) || exit 1; \
done
Expand All @@ -449,18 +449,16 @@ ifdef PARALLEL_DIRS
all :: $(addsuffix /.makeall , $(PARALLEL_DIRS))
install :: $(addsuffix /.makeinstall , $(PARALLEL_DIRS))
clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS))
cleandeps:: $(addsuffix /.makecleandeps, $(PARALLEL_DIRS))
test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS))

%/.makeall %/.makeinstall %/.makeclean %/.makecleandeps %/.maketest \
%/.makebytecode:
%/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode:
$(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
endif

# Handle directories that may or may not exist
ifdef OPTIONAL_DIRS
all install clean cleandeps test bytecode ::
all install clean test bytecode ::
$(VERB) for dir in ${OPTIONAL_DIRS}; do \
if [ -d $$dir ]; \
then\
Expand Down Expand Up @@ -821,28 +819,26 @@ SourceBaseNames := $(basename $(notdir $(filter-out Debug/%, $(Source))))
SourceDepend := $(SourceBaseNames:%=$(BUILD_OBJ_DIR)/Depend/%.d)

# Create dependencies for the *.cpp files...
#$(SourceDepend): \x
$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Depend/.dir
$(VERB) $(Depend) $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
$(VERB) $(Depend) $< | $(SED) 's|$*.o: $*.cpp||' | $(SED) 's|[^\]$$|&::|' >> $@

# Create dependencies for the *.c files...
#$(SourceDepend): \x
$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Depend/.dir
$(VERB) $(DependC) -o $@ $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
$(VERB) $(Depend) $< | $(SED) 's|$*.o: $*.c||' | $(SED) 's|[^\]$$|&::|' >> $@

#
# Include dependencies generated from C/C++ source files, but not if we
# are cleaning (this example taken from the GNU Make Manual).
#
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(MAKECMDGOALS),cleandeps)
ifneq ($(SourceDepend),)
-include $(SourceDepend)
endif
endif
endif
endif

cleandeps::
$(VERB) rm -f $(SourceDepend)
Expand Down

0 comments on commit fbb574d

Please sign in to comment.