Blame include/buildrules

Packit b0b924
#
Packit b0b924
# Copyright (c) 1999, 2001-2003 Silicon Graphics, Inc.  All Rights Reserved.
Packit b0b924
#
Packit b0b924
# This program is free software; you can redistribute it and/or modify it
Packit b0b924
# under the terms of version 2 of the GNU General Public License as published
Packit b0b924
# by the Free Software Fondation.
Packit b0b924
#
Packit b0b924
# This program is distributed in the hope that it would be useful, but WITHOUT
Packit b0b924
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit b0b924
# FITNESS FOR A PARTICULAR PURPOSE.  Further, any license provided herein,
Packit b0b924
# whether implied or otherwise, is limited to this program in accordance with
Packit b0b924
# the express provisions of the GNU General Public License.  Patent licenses,
Packit b0b924
# if any, provided herein do not apply to combinations of this program with
Packit b0b924
# other product or programs, or any other product whatsoever.  This program is
Packit b0b924
# distributed without any warranty that the program is delivered free of the
Packit b0b924
# rightful claim of any third person by way of infringement or the like.  See
Packit b0b924
# the GNU General Public License for more details.
Packit b0b924
#
Packit b0b924
# You should have received a copy of the GNU General Public License along with
Packit b0b924
# this program; if not, write the Free Software Foundation, Inc., 59 Temple
Packit b0b924
# Place - Suite 330, Boston MA 02111-1307, USA.
Packit b0b924
# Common build rules for gmake
Packit b0b924
#
Packit b0b924
ifndef _BUILDRULES_INCLUDED_
Packit b0b924
_BUILDRULES_INCLUDED_ = 1
Packit b0b924
Packit b0b924
include $(TOPDIR)/include/builddefs
Packit b0b924
Packit b0b924
clean clobber : $(SUBDIRS)
Packit b0b924
	rm -f $(DIRT)
Packit b0b924
	@rm -fr .libs
Packit b0b924
	$(SUBDIRS_MAKERULE)
Packit b0b924
Packit b0b924
# Never blow away subdirs
Packit b0b924
ifdef SUBDIRS
Packit b0b924
.PRECIOUS: $(SUBDIRS)
Packit b0b924
$(SUBDIRS):
Packit b0b924
	$(SUBDIRS_MAKERULE)
Packit b0b924
endif
Packit b0b924
Packit b0b924
#
Packit b0b924
# Standard targets
Packit b0b924
#
Packit b0b924
Packit b0b924
ifdef LTCOMMAND
Packit b0b924
$(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES)
Packit b0b924
	$(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
Packit b0b924
endif
Packit b0b924
Packit b0b924
ifdef LTLIBRARY
Packit b0b924
$(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
Packit b0b924
	$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
Packit b0b924
Packit b0b924
%.lo: %.c
Packit b0b924
	$(LTCOMPILE) -c $<
Packit b0b924
endif
Packit b0b924
Packit b0b924
ifdef LINGUAS
Packit b0b924
%.pot: $(XGETTEXTFILES)
Packit b0b924
	xgettext --omit-header --language=C --keyword=_ -o $@ $(XGETTEXTFILES)
Packit b0b924
Packit b0b924
%.po:
Packit b0b924
	$(MSGMERGE) -o $@.tmpo $@ $(PKG_NAME).pot
Packit b0b924
	@if ! diff $@.tmpo $@ >/dev/null; then \
Packit b0b924
		echo "$@ is out of date, see $@.tmpo"; \
Packit b0b924
	fi
Packit b0b924
Packit b0b924
%.mo: %.po
Packit b0b924
	$(MSGFMT) -o $@ $<
Packit b0b924
endif
Packit b0b924
Packit b0b924
source :
Packit b0b924
	$(SOURCE_MAKERULE)
Packit b0b924
Packit b0b924
endif # _BUILDRULES_INCLUDED_
Packit b0b924
Packit b0b924
$(_FORCE):
Packit b0b924
Packit b0b924
.PHONY : depend
Packit b0b924
Packit b0b924
depend : $(CFILES) $(HFILES)
Packit b0b924
	$(SUBDIRS_MAKERULE)
Packit b0b924
	touch .dep
Packit b0b924
	$(MAKEDEPEND) -f - -- $(CFLAGS) -- $(CFILES) | \
Packit b0b924
	$(SED) -e 's,`pwd`,$(TOPDIR),g' \
Packit b0b924
	    -e 's,  */[^ ]*,,g' \
Packit b0b924
	    -e '/^[^ ]*: *$$/d' \
Packit b0b924
	    -e '/^#.*/d' -e '/^ *$$/d' \
Packit b0b924
	> .dep
Packit b0b924
	test -s .dep || rm -f .dep
Packit b0b924
Packit b0b924
# Include dep, but only if it exists
Packit b0b924
ifeq ($(shell test -f .dep && echo .dep), .dep)
Packit b0b924
include .dep
Packit b0b924
endif