]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | # |
6e3140c7 | 2 | # Copyright (c) 1999, 2001-2003 Silicon Graphics, Inc. All Rights Reserved. |
2bd0ea18 NS |
3 | # |
4 | ifndef _BUILDRULES_INCLUDED_ | |
5 | _BUILDRULES_INCLUDED_ = 1 | |
6 | ||
7 | include $(TOPDIR)/include/builddefs | |
8 | ||
2a519b73 | 9 | clean clobber : $(addsuffix -clean,$(SUBDIRS)) |
932b0ba9 | 10 | @rm -f $(DIRT) .ltdep .dep |
35714853 | 11 | @rm -fr $(DIRDIRT) |
2a519b73 | 12 | %-clean: |
35714853 DC |
13 | @echo "Cleaning $*" |
14 | $(Q)$(MAKE) $(MAKEOPTS) -C $* clean | |
2bd0ea18 | 15 | |
337d9a24 DC |
16 | headers: $(addsuffix -headers, $(HDR_SUBDIRS)) |
17 | %-headers: | |
18 | @echo " [HEADERS] $*" | |
19 | $(Q)$(MAKE) $(MAKEOPTS) -C $* headers | |
20 | ||
2bd0ea18 NS |
21 | # Never blow away subdirs |
22 | ifdef SUBDIRS | |
23 | .PRECIOUS: $(SUBDIRS) | |
2a519b73 BN |
24 | .PHONY: $(SUBDIRS) |
25 | ||
2bd0ea18 | 26 | $(SUBDIRS): |
35714853 DC |
27 | @echo "Building $@" |
28 | $(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@ | |
2bd0ea18 NS |
29 | endif |
30 | ||
f937adac NS |
31 | # |
32 | # Standard targets | |
33 | # | |
34 | ||
35 | ifdef LTCOMMAND | |
36 | $(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES) | |
35714853 DC |
37 | @echo " [LD] $@" |
38 | $(Q)$(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS) | |
f937adac NS |
39 | endif |
40 | ||
41 | ifdef LTLIBRARY | |
42 | $(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS) | |
35714853 DC |
43 | @echo " [LD] $@" |
44 | $(Q)$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS) | |
f937adac NS |
45 | |
46 | %.lo: %.c | |
35714853 DC |
47 | @echo " [CC] $@" |
48 | $(Q)$(LTCOMPILE) -c $< | |
49 | else | |
50 | %.o: %.c | |
51 | @echo " [CC] $@" | |
52 | $(Q)$(CC) $(CFLAGS) -c $< | |
53 | ||
f937adac NS |
54 | endif |
55 | ||
1b758ea9 | 56 | ifdef POTHEAD |
a1f9bd42 | 57 | $(POTHEAD): $(XGETTEXTFILES) |
35714853 DC |
58 | @echo " [GETTXT] $@" |
59 | $(Q)$(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES) | |
9440d84d | 60 | |
8c053393 AM |
61 | # Update translations |
62 | update-po: $(POTHEAD) $(wildcard $(TOPDIR)/po/*.po) | |
9e95c34e | 63 | catalogs="$(wildcard $(TOPDIR)/po/*.po)"; \ |
8c053393 AM |
64 | for cat in $$catalogs; do \ |
65 | lang=`basename $$cat .po`; \ | |
66 | mv $$lang.po $$lang.old.po; \ | |
67 | echo "$$lang:"; \ | |
68 | if $(MSGMERGE) $$lang.old.po $(POTHEAD) -o $$lang.po; then \ | |
69 | rm -f $$lang.old.po; \ | |
70 | else \ | |
71 | echo "msgmerge for $$lang failed!"; \ | |
72 | rm -f $$lang.po; \ | |
73 | mv $$lang.old.po $$lang.po; \ | |
74 | fi; \ | |
75 | done | |
9440d84d | 76 | |
638473d8 | 77 | %.mo: %.po |
35714853 DC |
78 | @echo " [MSGFMT] $@" |
79 | $(Q)$(MSGFMT) -c --statistics -o $@ $< | |
9440d84d NS |
80 | endif |
81 | ||
f937adac | 82 | endif # _BUILDRULES_INCLUDED_ |
2bd0ea18 NS |
83 | |
84 | $(_FORCE): | |
85 | ||
d9320881 | 86 | # dependency build is automatic, relies on gcc -MM to generate. |
270c3128 DC |
87 | # |
88 | # This is a bit messy. It regenerates the dependencies on each build so | |
89 | # that we catch files being added and removed. There are other ways of doing | |
90 | # this (e.g. per-file dependency files) but that requires more in-depth changes | |
91 | # to the build system. Compile time is not an issue for us, so the | |
92 | # rebuild on every make invocation isn't a problem we need to care about. Just | |
93 | # do it silently so it doesn't make the build unnecessarily noisy. | |
94 | ||
d9320881 | 95 | .PHONY : depend ltdepend install-qa |
2bd0ea18 | 96 | |
d9320881 | 97 | MAKEDEP := $(MAKEDEPEND) $(CFLAGS) |
82f8efc6 | 98 | |
270c3128 DC |
99 | ltdepend: rmltdep .ltdep |
100 | ||
101 | rmltdep: | |
636b4d91 | 102 | $(Q)rm -f .ltdep |
932b0ba9 AE |
103 | |
104 | .ltdep: $(CFILES) $(HFILES) | |
932b0ba9 AE |
105 | $(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep |
106 | ||
270c3128 DC |
107 | depend: rmdep .dep |
108 | ||
109 | rmdep: | |
636b4d91 | 110 | $(Q)rm -f .dep |
82f8efc6 | 111 | |
932b0ba9 | 112 | .dep: $(CFILES) $(HFILES) |
d9320881 | 113 | $(Q)$(MAKEDEP) $(CFILES) > .dep |