Files
apfstests/include/buildrules
T
Alex Elder 2294e28218 xfstests: fix depend targets
There's no need to re-make the dependency files all the time.  Make
it so the "depend" target rebuilds the ".dep" file only if necessary.
Also change the name of the dependency file created for "ltdepend"
to be ".ltdep".

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-08-03 09:23:00 -05:00

92 lines
1.9 KiB
Plaintext

#
# Copyright (c) 1999, 2001-2003 Silicon Graphics, Inc. All Rights Reserved.
#
ifndef _BUILDRULES_INCLUDED_
_BUILDRULES_INCLUDED_ = 1
include $(TOPDIR)/include/builddefs
clean clobber : $(addsuffix -clean,$(SUBDIRS))
$(Q)rm -f $(DIRT)
$(Q)rm -fr .libs .ltdep .dep
%-clean:
@echo "Cleaning $*"
$(Q)$(MAKE) $(MAKEOPTS) -q -C $* clean || $(MAKE) $(MAKEOPTS) -C $* clean
# Never blow away subdirs
ifdef SUBDIRS
.PRECIOUS: $(SUBDIRS)
.PHONY: $(SUBDIRS)
$(SUBDIRS):
@echo "Building $@"
$(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@
endif
#
# Standard targets
#
ifdef LTCOMMAND
$(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES)
@echo " [LD] $*"
$(Q)$(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
endif
ifdef LTLIBRARY
$(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
@echo " [LD] $*"
$(Q)$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
%.lo: %.c
@echo " [CC] $@"
$(Q)$(LTCOMPILE) -c $<
else
%.o: %.c
@echo " [CC] $@"
$(Q)$(CC) $(CFLAGS) -c $<
endif
ifdef POTHEAD
%.pot: $(XGETTEXTFILES)
$(XGETTEXT) --language=C --keyword=_ -o $@ $(XGETTEXTFILES)
# Generate temp .po files, to check whether translations need updating.
# Not by default, due to gettext output differences between versions.
%.po: $(POTHEAD)
# $(MSGMERGE) -o $@.tmpo $@ $(POTHEAD)
# if ! diff $@.tmpo $@ >/dev/null; then echo "$@ dated, see $@.tmpo"; fi
%.mo: %.po
$(MSGFMT) -o $@ $<
endif
source :
$(SOURCE_MAKERULE)
endif # _BUILDRULES_INCLUDED_
$(_FORCE):
# dependency build is automatic, relies on gcc -MM to generate.
.PHONY : depend ltdepend
MAKEDEP := $(MAKEDEPEND) $(CFLAGS)
ltdepend: .ltdep
.ltdep: $(CFILES) $(HFILES)
@echo " [LTDEP]"
$(Q)[ -n "$(CFILES)" ] && \
$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep
depend: .dep
.dep: $(CFILES) $(HFILES)
@echo " [DEP]"
$(Q)[ -n "$(CFILES)" ] && \
$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1,' > .dep