-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
187 lines (156 loc) · 6.12 KB
/
Makefile.in
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
VERSION = @VERSION@
srcdir = @srcdir@
VPATH = $(srcdir)
install_prefix =
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
mandir = @mandir@
libdir = @libdir@
datadir = @datadir@
atdatadir = $(datadir)/at
man1dir = $(mandir)/man1
man5dir = $(mandir)/man5
man8dir = $(mandir)/man8
docdir = $(prefix)/doc
atdocdir = $(docdir)/at
etcdir = @ETCDIR@
atjobdir = @ATJBD@
systemdsystemunitdir = @systemdsystemunitdir@
ifdef IROOT
DESTDIR = $(IROOT)
$(warning IROOT is deprecated, you should use DESTDIR instead)
endif
DAEMON_USERNAME = @DAEMON_USERNAME@
DAEMON_GROUPNAME= @DAEMON_GROUPNAME@
LOADAVG_MX = @LOADAVG_MX@
ATJOB_DIR = @ATJBD@
ATSPOOL_DIR = @ATSPD@
LN_S = @LN_S@
YACC = @YACC@
LEX = @LEX@
LEXLIB = @LEXLIB@
CC = @CC@
CFLAGS = -I$(srcdir) @CFLAGS@
LDFLAGS = @LDFLAGS@
LFILE = $(ATJOB_DIR)/.SEQ
DEFS = @DEFS@ -DVERSION=\"$(VERSION)\" \
-DETCDIR=\"$(etcdir)\" -DLOADAVG_MX=$(LOADAVG_MX) \
-DDAEMON_USERNAME=\"$(DAEMON_USERNAME)\" \
-DDAEMON_GROUPNAME=\"$(DAEMON_GROUPNAME)\" \
-DLFILE=\"$(LFILE)\" -Wall
LIBS = @LIBS@
LIBOBJS = @LIBOBJS@
INSTALL = @INSTALL@
PAMLIB = @PAMLIB@
SELINUXLIB = @SELINUXLIB@
CLONES = atq atrm
ATOBJECTS = at.o panic.o perm.o posixtm.o y.tab.o lex.yy.o
RUNOBJECTS = atd.o daemon.o $(LIBOBJS)
CSRCS = at.c atd.c panic.c perm.c posixtm.c daemon.c getloadavg.c \
y.tab.c y.tab.h lex.yy.c
HEADERS = at.h panic.h parsetime.h perm.h posixtm.h daemon.h \
getloadavg.h privs.h
OTHERS = parsetime.l parsetime.y parsetime.pl
DOCS = Problems Copyright README ChangeLog timespec
MISC = COPYING Makefile.in configure acconfig.h install-sh \
README atrun.in at.1.in atrun.8.in atd.8.in at.allow.5.in \
configure.in config.h.in config.guess config.sub batch.in at.deny \
atd.service.in \
$(DOCS)
DIST = $(CSRCS) $(HEADERS) $(MISC) $(OTHERS)
LIST = Filelist Filelist.asc
.PHONY: all install clean dist distclean
all: at atd atd.service atrun
at: $(ATOBJECTS)
$(CC) $(LDFLAGS) -o at $(ATOBJECTS) $(LIBS) $(LEXLIB)
rm -f $(CLONES)
$(LN_S) -f at atq
$(LN_S) -f at atrm
atd: $(RUNOBJECTS)
$(CC) $(LDFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB) $(SELINUXLIB)
y.tab.c y.tab.h: parsetime.y
$(YACC) -d parsetime.y
lex.yy.c: parsetime.l
$(LEX) -i parsetime.l
parsetime.l: y.tab.h
atd.service: atd.service.in
cat $< | sed -e 's![@]sbindir[@]!$(sbindir)!g' | sed -e 's![@]atjobdir[@]!$(atjobdir)!g' > $@
atrun: atrun.in
configure
.c.o:
$(CC) -c $(CFLAGS) $(DEFS) $*.c
install: all
$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(etcdir)
$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(bindir)
$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(sbindir)
$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(atdatadir)
$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(docdir)
$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(atdocdir)
$(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 755 -d $(DESTDIR)$(ATSPOOL_DIR) $(DESTDIR)$(ATJOB_DIR)
chmod 1770 $(DESTDIR)$(ATSPOOL_DIR) $(DESTDIR)$(ATJOB_DIR)
touch $(DESTDIR)$(LFILE)
chmod 600 $(DESTDIR)$(LFILE)
chown $(DAEMON_USERNAME):$(DAEMON_GROUPNAME) $(DESTDIR)$(LFILE)
test -f $(DESTDIR)$(etcdir)/at.allow || test -f $(DESTDIR)$(etcdir)/at.deny || $(INSTALL) -o root -g $(DAEMON_GROUPNAME) -m 640 at.deny $(DESTDIR)$(etcdir)/
$(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 6755 at $(DESTDIR)$(bindir)
$(LN_S) -f at $(DESTDIR)$(bindir)/atq
$(LN_S) -f at $(DESTDIR)$(bindir)/atrm
$(INSTALL) -g root -o root -m 755 batch $(DESTDIR)$(bindir)
$(INSTALL) -g root -o root -m 755 batch-job $(DESTDIR)$(atdatadir)
$(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man1dir)
$(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man5dir)
$(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man8dir)
$(INSTALL) -g root -o root -m 755 atd $(DESTDIR)$(sbindir)
$(INSTALL) -g root -o root -m 755 atrun $(DESTDIR)$(sbindir)
$(INSTALL) -g root -o root -m 644 at.1 $(DESTDIR)$(man1dir)/
cd $(DESTDIR)$(man1dir) && $(LN_S) -f at.1 atq.1 && $(LN_S) -f at.1 batch.1 && $(LN_S) -f at.1 atrm.1
$(INSTALL) -g root -o root -m 644 atd.8 $(DESTDIR)$(man8dir)/
sed "s,\$${exec_prefix},$(exec_prefix),g" <atrun.8>tmpman
$(INSTALL) -g root -o root -m 644 tmpman $(DESTDIR)$(man8dir)/atrun.8
rm -f tmpman
$(INSTALL) -g root -o root -m 644 at.allow.5 $(DESTDIR)$(man5dir)/
cd $(DESTDIR)$(man5dir) && $(LN_S) -f at.allow.5 at.deny.5
$(INSTALL) -g root -o root -m 644 $(DOCS) $(DESTDIR)$(atdocdir)
rm -f $(DESTDIR)$(mandir)/cat1/at.1* $(DESTDIR)$(mandir)/cat1/batch.1* \
$(DESTDIR)$(mandir)/cat1/atq.1*
rm -f $(DESTDIR)$(mandir)/cat1/atd.8*
if test x"$(systemdsystemunitdir)" != xno; then \
$(INSTALL) -o root -g root -m 755 -d $(DESTDIR)$(systemdsystemunitdir); \
$(INSTALL) -o root -g root -m 644 atd.service $(DESTDIR)$(systemdsystemunitdir); \
fi
dist: checkin $(DIST) $(LIST) Filelist.asc
(cd ..; tar cf - `for a in $(DIST) $(LIST); do echo at-$(VERSION)/$$a; done` |\
gzip -9 > at-$(VERSION).tar.gz)
pre: checkin $(DIST) $(LIST)
(cd ..; tar cf - `for a in $(DIST); do echo at-$(VERSION)/$$a; done` |\
gzip -9 > at-$(VERSION).tar.gz)
mv ../at-$(VERSION).tar.gz ../at-$(VERSION)-`date +%Y%m%d`.tar.gz
clean:
rm -f subs.sed *.o *.s at atd core a.out *~ $(CLONES) *.bak stamp-built
rm -f parsetest parsetime.c lex.yy.c y.tab.c y.tab.h
distclean: clean
rm -rf at.1 at.allow.5 atd.8 atrun.8 config.cache atrun batch config.h \
config.status Makefile config.log build atd.service
checkin: $(DIST)
test -d RCS && for a in $(DIST); do ci -l $$a ; done
Filelist: $(DIST)
md5sum $(DIST) > Filelist
Filelist.asc: Filelist
pgp -sba Filelist
parsetest: lex.yy.c y.tab.c
$(CC) -o parsetest $(CFLAGS) $(DEFS) -DTEST_PARSER -DNEED_YYWRAP lex.yy.c y.tab.c
test: parsetest
prove parsetime.pl
.depend: $(CSRCS)
gcc $(CFLAGS) $(DEFS) -MM $(CSRCS) > .depend
at.o: at.c config.h at.h panic.h parsetime.h perm.h posixtm.h privs.h
atd.o: atd.c config.h privs.h daemon.h getloadavg.h
panic.o: panic.c config.h panic.h at.h
parsetime.o: parsetime.c config.h at.h panic.h
perm.o: perm.c config.h privs.h at.h
posixtm.o: posixtm.c posixtm.h
daemon.o: daemon.c config.h daemon.h privs.h
getloadavg.o: getloadavg.c config.h getloadavg.h
y.tab.o: y.tab.c y.tab.h