]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/buildrules
Revert "Merge branch 'xfsprogs-dev'"
[thirdparty/xfsprogs-dev.git] / include / buildrules
1 #
2 # Copyright (c) 1999, 2001-2003 Silicon Graphics, Inc. All Rights Reserved.
3 #
4 ifndef _BUILDRULES_INCLUDED_
5 _BUILDRULES_INCLUDED_ = 1
6
7 include $(TOPDIR)/include/builddefs
8
9 clean clobber : $(addsuffix -clean,$(SUBDIRS))
10 rm -f $(DIRT)
11 @rm -fr .libs
12 %-clean:
13 $(MAKE) -C $* clean
14
15 # Never blow away subdirs
16 ifdef SUBDIRS
17 .PRECIOUS: $(SUBDIRS)
18 .PHONY: $(SUBDIRS)
19
20 $(SUBDIRS):
21 $(MAKE) -C $@
22 endif
23
24 #
25 # Standard targets
26 #
27
28 ifdef LTCOMMAND
29 $(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES)
30 $(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
31 endif
32
33 ifdef LTLIBRARY
34 $(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
35 $(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
36
37 %.lo: %.c
38 $(LTCOMPILE) -c $<
39 endif
40
41 ifdef POTHEAD
42 $(POTHEAD): $(XGETTEXTFILES)
43 $(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES)
44
45 # Update translations
46 update-po: $(POTHEAD) $(wildcard $(TOPDIR)/po/*.po)
47 catalogs=$(wildcard $(TOPDIR)/po/*.po); \
48 for cat in $$catalogs; do \
49 lang=`basename $$cat .po`; \
50 mv $$lang.po $$lang.old.po; \
51 echo "$$lang:"; \
52 if $(MSGMERGE) $$lang.old.po $(POTHEAD) -o $$lang.po; then \
53 rm -f $$lang.old.po; \
54 else \
55 echo "msgmerge for $$lang failed!"; \
56 rm -f $$lang.po; \
57 mv $$lang.old.po $$lang.po; \
58 fi; \
59 done
60
61 %.mo: %.po
62 $(MSGFMT) -c --statistics -o $@ $<
63 endif
64
65 source :
66 $(SOURCE_MAKERULE)
67
68 endif # _BUILDRULES_INCLUDED_
69
70 $(_FORCE):
71
72 .PHONY : depend install-qa
73
74 DEPENDSCRIPT := $(MAKEDEPEND) $(DEPENDFLAGS) -f - -- $(CFLAGS) -- $(CFILES) | \
75 $(SED) \
76 -e 's,`pwd`,$(TOPDIR),g' \
77 -e 's, */[^ ]*,,g' \
78 -e '/^[^ ]*: *$$/d' \
79 -e '/^ *$$/d'
80
81 ifdef LTLIBRARY
82 DEPENDSCRIPT := $(DEPENDSCRIPT) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,'
83 endif
84
85 depend : $(CFILES) $(HFILES) $(addsuffix -depend,$(SUBDIRS))
86 $(DEPENDSCRIPT) > .dep
87 test -s .dep || rm -f .dep
88
89 %-depend:
90 $(MAKE) -C $* depend
91
92 # Include dep, but only if it exists
93 ifeq ($(shell test -f .dep && echo .dep), .dep)
94 include .dep
95 else
96 ifdef LTLIBRARY
97 $(LTOBJECTS): $(HFILES)
98 else
99 $(OBJECTS): $(HFILES)
100 endif
101 endif