2 # Copyright (c) 1999, 2001-2003 Silicon Graphics, Inc. All Rights Reserved.
4 ifndef _BUILDRULES_INCLUDED_
5 _BUILDRULES_INCLUDED_ = 1
7 include $(TOPDIR)/include/builddefs
9 clean clobber : $(addsuffix -clean,$(SUBDIRS))
14 $(Q)$(MAKE) $(MAKEOPTS) -C $* clean
16 # Never blow away subdirs
23 $(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@
27 @test -z "$$DIR" && DIR="."; \
28 for f in `echo $(SRCFILES) $(SUBDIRS) $(POTHEAD)`; do \
29 if test -d $$f ; then \
30 mkdir $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION)/$$DIR/$$f || exit $$?; \
31 $(MAKEF) DIR=$$DIR/$$f -C $$f $@ || exit $$?; \
33 ln $$f $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION)/$$DIR/$$f || exit $$?; \
42 $(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES)
44 $(Q)$(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
48 $(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
50 $(Q)$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
54 $(Q)$(LTCOMPILE) -c $<
58 $(Q)$(CC) $(CFLAGS) -c $<
63 $(POTHEAD): $(XGETTEXTFILES)
65 $(Q)$(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES)
68 update-po: $(POTHEAD) $(wildcard $(TOPDIR)/po/*.po)
69 catalogs=$(wildcard $(TOPDIR)/po/*.po); \
70 for cat in $$catalogs; do \
71 lang=`basename $$cat .po`; \
72 mv $$lang.po $$lang.old.po; \
74 if $(MSGMERGE) $$lang.old.po $(POTHEAD) -o $$lang.po; then \
75 rm -f $$lang.old.po; \
77 echo "msgmerge for $$lang failed!"; \
79 mv $$lang.old.po $$lang.po; \
85 $(Q)$(MSGFMT) -c --statistics -o $@ $<
88 endif # _BUILDRULES_INCLUDED_
92 .PHONY : depend install-qa
94 DEPENDSCRIPT := $(MAKEDEPEND) $(DEPENDFLAGS) -f - -- $(CFLAGS) -- $(CFILES) | \
96 -e 's,`pwd`,$(TOPDIR),g' \
102 DEPENDSCRIPT := $(DEPENDSCRIPT) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,'
105 depend : $(CFILES) $(HFILES) $(addsuffix -depend,$(SUBDIRS))
106 $(DEPENDSCRIPT) > .dep
107 test -s .dep || rm -f .dep
112 # Include dep, but only if it exists
113 ifeq ($(shell test -f .dep && echo .dep), .dep)
117 $(LTOBJECTS): $(HFILES)
119 $(OBJECTS): $(HFILES)