summaryrefslogtreecommitdiff
path: root/Makefile.in
blob: c81d7a9e44acc60da2fcd980b7fb12ef3d5d5999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
PROGS         = quotacheck quotaon quota quot repquota warnquota quotastats xqmstats edquota setquota convertquota rpc.rquotad quotasync @QUOTA_NETLINK_PROG@
SOURCES       = bylabel.c common.c convertquota.c edquota.c pot.c quot.c quota.c quotacheck.c quotacheck_v1.c quotacheck_v2.c quotaio.c quotaio_rpc.c quotaio_v1.c quotaio_v2.c quotaio_tree.c quotaio_xfs.c quotaio_meta.c quotaio_generic.c quotaon.c quotaon_xfs.c quotaops.c quotastats.c quotasys.c repquota.c rquota_client.c rquota_server.c rquota_svc.c setquota.c warnquota.c xqmstats.c svc_socket.c quotasync.c
CFLAGS        = @CFLAGS@ -D_GNU_SOURCE -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
CPPFLAGS      = @CPPFLAGS@
EXT2LIBS      = @EXT2LIBS@
NETLINKLIBS   = @NETLINKLIBS@
RPCSRC        = rquota.h rquota_xdr.c rquota_clnt.c
LIBS          = @LIBS@
LDFLAGS       = @LDFLAGS@
LDAPLIBS      = @LDAPLIBS@

INSTALL       = @INSTALL@
STRIP         = @STRIP@
LN            = ln -sf
ROOTDIR       =
SUPER_OWNER   = root
BIN_OWNER     = bin
BIN_GROUP     = bin
DEF_SUID_MODE = 4511
DEF_BIN_MODE = 555
DEF_SBIN_MODE = 555
DEF_MAN_MODE  = 444
DEF_CONF_MODE = 644
RPCGEN        = rpcgen

prefix        = @prefix@
bindir        = $(prefix)/bin
sbindir       = $(prefix)/sbin
root_sbindir  = @ROOTSBIN@
mandir        = @mandir@
includedir    = $(prefix)/include
locale_dir    = $(prefix)/share/locale
sysconfdir    = @sysconfdir@
datarootdir   = @datarootdir@

RPCCLNTOBJS = rquota_xdr.o rquota_client.o rquota_clnt.o
IOOBJS = quotaio.o quotaio_v1.o quotaio_v2.o quotaio_tree.o quotaio_rpc.o quotaio_xfs.o quotaio_meta.o quotaio_generic.o
IOOBJS += $(RPCCLNTOBJS)
LIBOBJS = bylabel.o common.o quotasys.o pot.o $(IOOBJS)
LIBOBJS += @LIBMALLOC@

.PHONY: all clean clobber realclean pot mo inst_mo

.%.d: %.c
	set -e; $(CC) -MM -MG $(CPPFLAGS) $(CFLAGS) $< | \
		sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
		[ -s $@ ] || rm -f $@
 
all: $(PROGS)

clean:
	-rm -f core *.o .*.d

clobber: clean
	-rm -f $(PROGS) Makefile config.status config.cache config.log config.h

realclean: clobber
	-rm -f $(RPCSRC) po/*.mo

pot:
	xgettext -k_ -kN_ -d pot *.c *.h

mo: po
	for n in $(shell ls po/*.po); do \
	msgfmt -o po/`basename $$n .po`.mo $$n; \
	done

inst_mo: mo
	mkdir -p $(ROOTDIR)$(locale_dir)
	for n in $(shell ls po/*.po | sed 's/\.po/\.mo/'); do \
	l=`basename $$n .mo`; \
	$(INSTALL) -m 755 -d $(ROOTDIR)$(locale_dir)/$$l; \
	$(INSTALL) -m 755 -d $(ROOTDIR)$(locale_dir)/$$l/LC_MESSAGES; \
	$(INSTALL) -m 644 $$n $(ROOTDIR)$(locale_dir)/$$l/LC_MESSAGES/quota.mo; \
	done

install: all @INSTMO@
	-mkdir -p $(ROOTDIR)$(sbindir)
	-mkdir -p $(ROOTDIR)$(bindir)
	-mkdir -p $(ROOTDIR)$(root_sbindir)
	-$(INSTALL) $(STRIP) -m $(DEF_SBIN_MODE) \
	quotacheck quotaon $(ROOTDIR)$(root_sbindir)
	-$(LN) quotaon $(ROOTDIR)$(root_sbindir)/quotaoff
	-$(INSTALL) $(STRIP) -m $(DEF_SBIN_MODE) \
	edquota repquota warnquota quotastats setquota quot xqmstats \
	convertquota $(ROOTDIR)$(sbindir)
	-mkdir -p $(ROOTDIR)$(sysconfdir)
	-$(INSTALL) -m $(DEF_CONF_MODE) warnquota.conf $(ROOTDIR)$(sysconfdir)
	-$(INSTALL) -m $(DEF_CONF_MODE) quotatab $(ROOTDIR)$(sysconfdir)
	-$(INSTALL) -m $(DEF_CONF_MODE) quotagrpadmins $(ROOTDIR)$(sysconfdir)
	-mkdir -p $(ROOTDIR)$(mandir)/man1
	-mkdir -p $(ROOTDIR)$(mandir)/man2
	-mkdir -p $(ROOTDIR)$(mandir)/man3
	-mkdir -p $(ROOTDIR)$(mandir)/man8
	-$(INSTALL) -m 755 -d $(ROOTDIR)$(includedir)/rpcsvc
	-$(INSTALL) -m 644 rquota.h rquota.x $(ROOTDIR)$(includedir)/rpcsvc
	-$(INSTALL) $(STRIP) -m $(DEF_SBIN_MODE) quota quotasync $(ROOTDIR)$(bindir)
	-$(INSTALL) $(STRIP) -m $(DEF_SBIN_MODE) rpc.rquotad $(ROOTDIR)$(sbindir)
ifneq ($(NETLINKLIBS),)
	-$(INSTALL) $(STRIP) -m $(DEF_SBIN_MODE) quota_nld $(ROOTDIR)$(sbindir)
endif
	-$(INSTALL) -m $(DEF_MAN_MODE) *.1 $(ROOTDIR)$(mandir)/man1
	-$(INSTALL) -m $(DEF_MAN_MODE) *.2 $(ROOTDIR)$(mandir)/man2
	-$(INSTALL) -m $(DEF_MAN_MODE) *.3 $(ROOTDIR)$(mandir)/man3
	-$(INSTALL) -m $(DEF_MAN_MODE) *.8 $(ROOTDIR)$(mandir)/man8

quotaon: quotaon.o quotaon_xfs.o $(LIBOBJS)

quotacheck: quotacheck.o quotacheck_v1.o quotacheck_v2.o quotaops.o $(LIBOBJS)
	$(CC) $(LDFLAGS) -o $@ $^ $(EXT2LIBS)

quota: quota.o quotaops.o $(LIBOBJS)

quotasync: quotasync.o $(LIBOBJS)

quot: quot.o $(LIBOBJS)

repquota: repquota.o $(LIBOBJS)

warnquota: warnquota.o $(LIBOBJS)
	$(CC) $(LDFLAGS) -o $@ $^ $(LDAPLIBS)

quotastats: quotastats.o common.o pot.o

xqmstats: xqmstats.o common.o pot.o

edquota: edquota.o quotaops.o $(LIBOBJS)

setquota: setquota.o quotaops.o $(LIBOBJS)

convertquota: convertquota.o $(LIBOBJS)

rpc.rquotad: rquota_server.o rquota_svc.o svc_socket.o $(LIBOBJS)
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)

ifneq ($(NETLINKLIBS),)
quota_nld: quota_nld.o $(LIBOBJS)
	$(CC) $(LDFLAGS) -o $@ $^ $(NETLINKLIBS)
endif

pot.o: pot.c pot.h

rquota.h: rquota.x
	$(RPCGEN) -h -o $@ $<

rquota_xdr.c: rquota.x
	$(RPCGEN) -c -o $@ $<

rquota_xdr.o: rquota_xdr.c rquota.h
	$(CC) $(CFLAGS) -Wno-unused -c $<

rquota_clnt.c: rquota.x
	$(RPCGEN) -l -o $@ $<

-include $(SOURCES:%.c=.%.d)