make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / compiled-tools / lastcsv.d / Makefile
blob5627fa6fcc608ad504c2b9e92dc1d61c7de50d71
2 # Makefile Makefile for the systemV init suite.
3 # Targets: all compiles everything
4 # install installs the binaries (not the scripts)
5 # clean cleans up object files
6 # clobber really cleans up
8 # Version: @(#)Makefile 2.85-13 23-Mar-2004 miquels@cistron.nl
11 CPPFLAGS =
12 CFLAGS ?= -ansi -O2 -fomit-frame-pointer
13 override CFLAGS += -W -Wall -D_GNU_SOURCE
14 STATIC =
16 # For some known distributions we do not build all programs, otherwise we do.
17 BIN =
18 SBIN = init halt shutdown runlevel killall5 fstab-decode
19 USRBIN = lastcsv mesg
21 MAN1 = lastcsv.1 lastbcsv.1 mesg.1
22 MAN5 = initscript.5 inittab.5
23 MAN8 = halt.8 init.8 killall5.8 pidof.8 poweroff.8 reboot.8 runlevel.8
24 MAN8 += shutdown.8 telinit.8 fstab-decode.8
26 ifeq ($(DISTRO),)
27 BIN += mountpoint
28 SBIN += sulogin bootlogd
29 USRBIN += utmpdump wall
30 MAN1 += utmpdump.1 mountpoint.1 wall.1
31 MAN8 += sulogin.8 bootlogd.8
32 endif
34 ifeq ($(DISTRO),Debian)
35 CPPFLAGS+= -DACCTON_OFF
36 BIN += mountpoint
37 SBIN += sulogin bootlogd
38 MAN1 += mountpoint.1
39 MAN8 += sulogin.8 bootlogd.8
40 endif
42 ifeq ($(DISTRO),Owl)
43 USRBIN += wall
44 MAN1 += wall.1
45 endif
47 ifeq ($(DISTRO),SuSE)
48 CPPFLAGS+= -DUSE_SYSFS -DSANE_TIO -DSIGINT_ONLYONCE -DUSE_ONELINE
49 BIN += mountpoint
50 SBIN += sulogin
51 USRBIN += utmpdump
52 MAN1 += utmpdump.1 mountpoint.1
53 MAN8 += sulogin.8
54 endif
56 ID = $(shell id -u)
57 BIN_OWNER = root
58 BIN_GROUP = root
59 BIN_COMBO = $(BIN_OWNER):$(BIN_GROUP)
60 ifeq ($(ID),0)
61 INSTALL_EXEC = install -o $(BIN_OWNER) -g $(BIN_GROUP) -m 755
62 INSTALL_DATA = install -o $(BIN_OWNER) -g $(BIN_GROUP) -m 644
63 else
64 INSTALL_EXEC = install -m 755
65 INSTALL_DATA = install -m 644
66 endif
67 INSTALL_DIR = install -m 755 -d
68 MANDIR = /usr/share/man
70 ifeq ($(WITH_SELINUX),yes)
71 SELINUX_DEF = -DWITH_SELINUX
72 INITLIBS += -lsepol -lselinux
73 SULOGINLIBS = -lselinux
74 else
75 SELINUX_DEF =
76 INITLIBS =
77 SULOGINLIBS =
78 endif
80 # Additional libs for GNU libc.
81 ifneq ($(wildcard /usr/lib*/libcrypt.a),)
82 SULOGINLIBS += -lcrypt
83 endif
85 all: $(BIN) $(SBIN) $(USRBIN)
87 #%: %.o
88 # $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
89 #%.o: %.c
90 # $(CC) $(CFLAGS) $(CPPFLAGS) -c $^ -o $@
92 init: LDLIBS += $(INITLIBS) $(STATIC)
93 init: init.o init_utmp.o
95 halt: halt.o ifdown.o hddown.o utmp.o reboot.h
97 lastcsv: lastcsv.o oldutmp.h
99 lastbcsv:
100 ln -sfn lastcsv lastbcsv
102 mesg: mesg.o
104 mountpoint: mountpoint.o
106 utmpdump: utmpdump.o
108 runlevel: runlevel.o
110 sulogin: LDLIBS += $(SULOGINLIBS) $(STATIC)
111 sulogin: sulogin.o
113 wall: dowall.o wall.o
115 shutdown: dowall.o shutdown.o utmp.o reboot.h
117 bootlogd: LDLIBS += -lutil
118 bootlogd: bootlogd.o
120 sulogin.o: CPPFLAGS += $(SELINUX_DEF)
121 sulogin.o: sulogin.c
123 init.o: CPPFLAGS += $(SELINUX_DEF)
124 init.o: init.c init.h set.h reboot.h initreq.h
126 utmp.o: utmp.c init.h
128 init_utmp.o: CPPFLAGS += -DINIT_MAIN
129 init_utmp.o: utmp.c init.h
130 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
132 cleanobjs:
133 rm -f *.o *.bak
135 clean: cleanobjs
136 @echo Type \"make clobber\" to really clean up.
138 clobber: cleanobjs
139 rm -f $(BIN) $(SBIN) $(USRBIN)
141 distclean: clobber
143 install:
144 $(INSTALL_DIR) $(ROOT)/bin/ $(ROOT)/sbin/
145 $(INSTALL_DIR) $(ROOT)/usr/bin/
146 for i in $(BIN); do \
147 $(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \
148 done
149 for i in $(SBIN); do \
150 $(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \
151 done
152 for i in $(USRBIN); do \
153 $(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \
154 done
155 # $(INSTALL_DIR) $(ROOT)/etc/
156 # $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/
157 ln -sf halt $(ROOT)/sbin/reboot
158 ln -sf halt $(ROOT)/sbin/poweroff
159 ln -sf init $(ROOT)/sbin/telinit
160 ln -sf /sbin/killall5 $(ROOT)/bin/pidof
161 if [ ! -f $(ROOT)/usr/bin/lastbcsv ]; then \
162 ln -sf lastcsv $(ROOT)/usr/bin/lastbcsv; \
164 $(INSTALL_DIR) $(ROOT)/usr/include/
165 $(INSTALL_DATA) initreq.h $(ROOT)/usr/include/
166 $(INSTALL_DIR) $(ROOT)$(MANDIR)/man1/
167 $(INSTALL_DIR) $(ROOT)$(MANDIR)/man5/
168 $(INSTALL_DIR) $(ROOT)$(MANDIR)/man8/
169 for i in $(MAN1); do \
170 $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man1/; \
171 done
172 for i in $(MAN5); do \
173 $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man5/; \
174 done
175 for i in $(MAN8); do \
176 $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man8/; \
177 done
178 ifeq ($(ROOT),)
180 # This part is skipped on Debian systems, the
181 # debian.preinst script takes care of it.
182 @if [ ! -p /dev/initctl ]; then \
183 echo "Creating /dev/initctl"; \
184 rm -f /dev/initctl; \
185 mknod -m 600 /dev/initctl p; fi
186 endif