]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - include/buildmacros
xfsprogs: don't allow udisks to automount XFS filesystems with no prompt
[thirdparty/xfsprogs-dev.git] / include / buildmacros
CommitLineData
959ef981 1# SPDX-License-Identifier: GPL-2.0
6e3140c7 2# Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved.
3ded4129
NS
3#
4
3ded4129
NS
5BUILDRULES = $(TOPDIR)/include/buildrules
6
7# LCFLAGS, LLDFLAGS, LLDLIBS, LSRCFILES and LDIRT may be specified in
8# user Makefiles. Note: LSRCFILES is anything other than Makefile, $(CFILES)
9# $(CXXFILES), or $(HFILES) and is used to construct the manifest list
10# during the "dist" phase (packaging).
11
e99e3d7d 12LDFLAGS += $(SANITIZER_LDFLAGS) $(LOADERFLAGS) $(LLDFLAGS)
1163c17d 13LTLDFLAGS += $(LOADERFLAGS)
93d9f139 14LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB)
3ded4129 15
35714853 16MAKEOPTS = --no-print-directory Q=$(Q)
3ded4129 17SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
a74fe294 18SRCFILES += $(QAHFILES)
9440d84d
NS
19
20DEPDIRT = dep dep.bak
21MANDIRT = *.[1-9].gz
22PODIRT = *.tmpo *.mo
23CDIRT = $(OBJECTS) $(LTOBJECTS) $(LTCOMMAND) $(LTLIBRARY)
24DIRT = $(LDIRT) $(DEPDIRT) $(MANDIRT) $(PODIRT) $(CDIRT)
42e5b5df
NS
25LIBDIRT = .libs
26DIRDIRT = $(LDIRDIRT) $(LIBDIRT)
3ded4129
NS
27
28OBJECTS = $(ASFILES:.s=.o) \
dfc130f3
RC
29 $(CFILES:.c=.o) \
30 $(LFILES:.l=.o) \
31 $(YFILES:%.y=%.tab.o)
3ded4129 32
93d9f139 33INSTALL = $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
3ded4129 34
3ded4129
NS
35IMAGES_DIR = $(TOPDIR)/all-images
36DIST_DIR = $(TOPDIR)/dist
37
4e6ff442 38CCF = $(CC) $(CFLAGS) $(CPPFLAGS)
3ded4129
NS
39MAKEF = $(MAKE) $(MAKEOPTS)
40CXXF = $(CXX) $(CXXFLAGS)
3ded4129
NS
41
42# For libtool.
43LIBNAME = $(basename $(LTLIBRARY))
44LTOBJECTS = $(OBJECTS:.o=.lo)
45LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
46
35714853
DC
47LTLINK = $(LIBTOOL) --quiet --tag=CC --mode=link $(CC)
48LTEXEC = $(LIBTOOL) --quiet --mode=execute
49LTINSTALL = $(LIBTOOL) --quiet --mode=install $(INSTALL)
50LTCOMPILE = $(LIBTOOL) --quiet --tag=CC --mode=compile $(CCF)
3ded4129
NS
51
52ifeq ($(ENABLE_SHARED),yes)
595e27db 53LTLDFLAGS += -rpath $(PKG_ROOT_LIB_DIR)
3ded4129
NS
54LTLDFLAGS += -version-info $(LTVERSION)
55endif
56
57ifeq ($(ENABLE_SHARED),yes)
58INSTALL_LTLIB = \
59 cd $(TOPDIR)/$(LIBNAME)/.libs; \
595e27db 60 ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
bf9ce9d9 61 ../$(INSTALL) -m 755 -T so_dot_version $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
595e27db 62 ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_ROOT_LIB_DIR)
3ded4129
NS
63endif
64
65# Libtool thinks the static and shared libs should be in the same dir, so
66# make the static lib appear in the place we chose as rpath (using the two
67# symlinks below).
68# Other things want the shared libs to appear in /usr/lib, else they'll
69# link with the static libs there. So, another symlink to get the .so into
70# /usr/lib.
71ifeq ($(ENABLE_SHARED),yes)
72INSTALL_LTLIB_DEV = \
73 cd $(TOPDIR)/$(LIBNAME)/.libs; \
74 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
595e27db
CH
75 ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
76 ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
77 ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
78 ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
02ef5434 79 if [ "x$(shell readlink -f $(PKG_LIB_DIR))" != \
255132ae 80 "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))" ]; then \
02ef5434
JT
81 ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
82 ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
83 ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
54dd1539 84 fi
3ded4129
NS
85else
86INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
87endif
88
89INSTALL_LTLIB_STATIC = \
90 cd $(TOPDIR)/$(LIBNAME)/.libs; \
595e27db
CH
91 ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
92 ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR)
3ded4129
NS
93
94INSTALL_MAN = \
4f3edd9e 95 @for d in $(MAN_PAGES); do \
3ded4129
NS
96 first=true; \
97 for m in `$(AWK) \
c2f38a4b 98 '/^\.S[h|H] NAME/ {ok=1; next} /^\.so/ {printf("so %s\n", FILENAME); exit} ok {print; exit}' $$d \
3ded4129
NS
99 | $(SED) \
100 -e 's/^\.Nm //' -e 's/,/ /g' -e 's/\\-.*//' \
c2f38a4b 101 -e 's/^so \([_a-zA-Z]*\)\.[0-9]/\1/g' \
3ded4129
NS
102 -e 's/\\\f[0-9]//g' -e 's/ / /g;q'`; \
103 do \
104 [ -z "$$m" -o "$$m" = "\\" ] && continue; \
105 t=$(MAN_DEST)/$$m.$(MAN_SECTION); \
106 if $$first; then \
107 if $(HAVE_ZIPPED_MANPAGES); then \
108 $(ZIP) -9 -c $$d > $$d.gz; _sfx=.gz; \
109 fi; \
110 u=$$m.$(MAN_SECTION)$$_sfx; \
111 echo $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx;\
112 $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \
113 else \
114 echo $(INSTALL) -S $$u $${t}$$_sfx; \
115 $(INSTALL) -S $$u $${t}$$_sfx; \
116 fi; \
117 first=false; \
118 done; \
119 done
120
9440d84d
NS
121ifeq ($(ENABLE_GETTEXT),yes)
122INSTALL_LINGUAS = \
f3e9ba96
SL
123 @for l in $(LINGUAS) ""; do \
124 if test -f "$$l.mo" ; then \
125 ldir=$(PKG_LOCALE_DIR)/$$l/LC_MESSAGES; \
126 $(INSTALL) -m 755 -d $$ldir; \
127 $(INSTALL) -m 644 $$l.mo $$ldir/$(PKG_NAME).mo; \
128 fi; \
9440d84d
NS
129 done
130endif
131
3ded4129
NS
132MAN_MAKERULE = \
133 @for f in *.[12345678] ""; do \
134 if test ! -z "$$f"; then \
135 $(ZIP) --best -c < $$f > $$f.gz; \
136 fi; \
137 done