1# This file is part of GNU Pies.
2# Copyright (C) 2008-2020 Sergey Poznyakoff
3#
4# GNU Pies is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3, or (at your option)
7# any later version.
8#
9# GNU Pies is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with GNU Pies.  If not, see <http://www.gnu.org/licenses/>. */
16
17sbin_PROGRAMS = pies
18bin_PROGRAMS = piesctl
19
20pies_SOURCES = \
21 acl.c\
22 comp.c\
23 ctl.c\
24 depmap.c\
25 diag.c\
26 inetd.c\
27 inetd-bi.c\
28 limits.c\
29 meta1parse.c\
30 pies.c\
31 progman.c\
32 socket.c\
33 syslog.c\
34 userprivs.c
35
36if PIES_COND_SYSVINIT
37pies_SOURCES += \
38 sysvinit.c\
39 sysdep.c\
40 utmp.c
41endif
42
43noinst_HEADERS = \
44 acl.h\
45 cmdline.h\
46 meta1parse.h\
47 pies.h\
48 pies_syslog.h\
49 prog.h\
50 piesctl-cl.h\
51 telinit.h
52
53BUILT_SOURCES=cmdline.h piesctl-cl.h telinit.h
54
55incdir=$(pkgdatadir)/$(VERSION)/include
56inc_DATA = pp-setup
57EXTRA_DIST = cmdline.opt piesctl-cl.opt telinit.opt pp-setup inetd.in
58
59SUFFIXES=.opt .c .h
60.opt.h:
61	$(AM_V_GEN)m4 -s $(top_srcdir)/@GRECS_SUBDIR@/build-aux/getopt.m4 $< > $@
62
63cmdline.h: cmdline.opt
64piesctl-cl.h: piesctl-cl.opt
65telinit.h: telinit.opt
66
67pies_LDADD = \
68 ../ident/libident.a\
69 ../lib/libpies.a\
70 @GRECS_LDADD@\
71 ../gnu/libgnu.a\
72 $(MF_PROCTITLE_LIBS)\
73 @PAM_LIBS@\
74 $(LTLIBINTL) $(LTLIBICONV)
75
76piesctl_SOURCES = piesctl.c
77
78piesctl_LDADD = \
79 ../lib/libpies.a\
80 @GRECS_LDADD@\
81 ../gnu/libgnu.a\
82 $(LTLIBINTL) $(LTLIBICONV)
83
84pkgstatedir=$(localstatedir)/pies
85
86AM_CPPFLAGS=\
87 -I$(top_srcdir)/lib\
88 -I$(top_srcdir)/ident\
89 -I$(top_srcdir)/gnu\
90 -I$(top_builddir)/gnu\
91 @GRECS_INCLUDES@\
92 -DDEFAULT_PREPROCESSOR="$(DEFAULT_PREPROCESSOR)"\
93 -DDEFAULT_VERSION_INCLUDE_DIR=\"$(incdir)\"\
94 -DDEFAULT_INCLUDE_DIR=\"$(pkgdatadir)/include\"\
95 -DDEFAULT_STATE_DIR=\"$(pkgstatedir)\"\
96 -DDEFAULT_PIES_CONTROL_URL='"$(DEFAULT_PIES_CONTROL_URL)"'\
97 -DDEFAULT_INIT_CONTROL_URL='"$(DEFAULT_INIT_CONTROL_URL)"'\
98 -DEMERGENCY_SHELL='"$(EMERGENCY_SHELL)"'
99
100EXTRA_SCRIPTS = inetd
101sbin_SCRIPTS = @INETD@
102
103inetd: inetd.in
104	$(AM_V_GEN)sed 's|_SBINDIR_|$(sbindir)|' \
105              $(top_srcdir)/src/inetd.in > $(top_builddir)/src/inetd
106
107install-data-hook:
108	test -d $(DESTDIR)$(pkgstatedir) || $(MKDIR_P) $(DESTDIR)$(pkgstatedir)
109