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))
10 @rm -f $(DIRT) .ltdep .dep
14 $(Q)$(MAKE) $(MAKEOPTS) -C $* clean
16 # Never blow away subdirs
23 $(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@
31 $(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES)
33 $(Q)$(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
37 $(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
39 $(Q)$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
43 $(Q)$(LTCOMPILE) -c $<
47 $(Q)$(CC) $(CFLAGS) -c $<
52 $(POTHEAD): $(XGETTEXTFILES)
54 $(Q)$(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES)
57 update-po: $(POTHEAD) $(wildcard $(TOPDIR)/po/*.po)
58 catalogs="$(wildcard $(TOPDIR)/po/*.po)"; \
59 for cat in $$catalogs; do \
60 lang=`basename $$cat .po`; \
61 mv $$lang.po $$lang.old.po; \
63 if $(MSGMERGE) $$lang.old.po $(POTHEAD) -o $$lang.po; then \
64 rm -f $$lang.old.po; \
66 echo "msgmerge for $$lang failed!"; \
68 mv $$lang.old.po $$lang.po; \
74 $(Q)$(MSGFMT) -c --statistics -o $@ $<
77 endif # _BUILDRULES_INCLUDED_
81 # dependency build is automatic, relies on gcc -MM to generate.
83 # This is a bit messy. It regenerates the dependencies on each build so
84 # that we catch files being added and removed. There are other ways of doing
85 # this (e.g. per-file dependency files) but that requires more in-depth changes
86 # to the build system. Compile time is not an issue for us, so the
87 # rebuild on every make invocation isn't a problem we need to care about. Just
88 # do it silently so it doesn't make the build unnecessarily noisy.
90 .PHONY : depend ltdepend install-qa
92 MAKEDEP := $(MAKEDEPEND) $(CFLAGS)
94 ltdepend: rmltdep .ltdep
99 .ltdep: $(CFILES) $(HFILES)
100 $(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep
107 .dep: $(CFILES) $(HFILES)
108 $(Q)$(MAKEDEP) $(CFILES) > .dep