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
19 headers: $(addsuffix -headers, $(HDR_SUBDIRS))
23 $(Q)$(MAKE) $(MAKEOPTS) -C $* NODEP=1 install-headers
29 # Never blow away subdirs
36 $(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@
44 $(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES)
46 $(Q)$(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
50 $(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
52 $(Q)$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
56 $(Q)$(LTCOMPILE) -c $<
60 $(Q)$(CC) $(CFLAGS) -c $<
65 $(POTHEAD): $(XGETTEXTFILES)
67 $(Q)$(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES)
70 update-po: $(POTHEAD) $(wildcard $(TOPDIR)/po/*.po)
71 catalogs="$(wildcard $(TOPDIR)/po/*.po)"; \
72 for cat in $$catalogs; do \
73 lang=`basename $$cat .po`; \
74 mv $$lang.po $$lang.old.po; \
76 if $(MSGMERGE) $$lang.old.po $(POTHEAD) -o $$lang.po; then \
77 rm -f $$lang.old.po; \
79 echo "msgmerge for $$lang failed!"; \
81 mv $$lang.old.po $$lang.po; \
87 $(Q)$(MSGFMT) -c --statistics -o $@ $<
90 endif # _BUILDRULES_INCLUDED_
94 # dependency build is automatic, relies on gcc -MM to generate.
96 # This is a bit messy. It regenerates the dependencies on each build so
97 # that we catch files being added and removed. There are other ways of doing
98 # this (e.g. per-file dependency files) but that requires more in-depth changes
99 # to the build system. Compile time is not an issue for us, so the
100 # rebuild on every make invocation isn't a problem we need to care about. Just
101 # do it silently so it doesn't make the build unnecessarily noisy.
103 .PHONY : depend ltdepend
105 MAKEDEP := $(MAKEDEPEND) $(CFLAGS)
107 ltdepend: rmltdep .ltdep
112 .ltdep: $(CFILES) $(HFILES)
113 $(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep
120 .dep: $(CFILES) $(HFILES)
121 $(Q)$(MAKEDEP) $(CFILES) > .dep