initscripts/src/Makefile

79 lines
2.7 KiB
Makefile
Raw Permalink Normal View History

2011-04-26 12:26:24 +02:00
# Makefile for the initscripts tools
# Copyright (C) 2007 by Davide Madrisan <davide.madrisan@gmail.com>
#
# Based on the Makefile provided by Fedora in the initscripts tarball
PROGS = usernetctl doexec netreport usleep ipcalc minilogd initlog fstab-decode getkey consoletype genhostid
INITLOG_OBJS = initlog.o process.o
USLEEP_OBJS = usleep.o
prefix = /usr
exec_prefix = ${prefix}
sysconfdir = /etc
sbindir = ${exec_prefix}/sbin
mandir = ${prefix}/share/man
localstatedir = /var
INSTALL = /usr/bin/install
INSTALL_PROGRAM = ${INSTALL} -m 755
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_DIR = ${INSTALL} -d -m 755
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
CFLAGS += $(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE
all: $(PROGS)
getkey: getkey.o
$(CC) $(LDFLAGS) -o $@ $< -Wl,-Bstatic -lpopt -Wl,-Bdynamic
initlog: $(INITLOG_OBJS)
$(CC) $(LDFLAGS) -o $@ $(INITLOG_OBJS) -Wl,-Bstatic -lpopt -Wl,-Bdynamic
ipcalc: ipcalc.o
$(CC) $(LDFLAGS) -o $@ $< -Wl,-Bstatic -lpopt -Wl,-Bdynamic
usleep: $(USLEEP_OBJS)
$(CC) $(LDFLAGS) -o $@ $(USLEEP_OBJS) -Wl,-Bstatic -lpopt -Wl,-Bdynamic
usernetctl.o: usernetctl.c
$(CC) $(CFLAGS) -fPIE -c usernetctl.c -o usernetctl.o
usernetctl: usernetctl.c usernetctl.o
$(CC) $(LDFLAGS) -pie -o $@ $@.o
install:
$(INSTALL_DIR) $(DESTDIR)/bin
$(INSTALL_DIR) $(DESTDIR)/sbin
$(INSTALL_DIR) $(DESTDIR)$(sbindir)
$(INSTALL_DIR) $(DESTDIR)$(mandir)/man{1,8}
$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)
$(INSTALL_DIR) $(DESTDIR)$(localstatedir)/run/netreport/
$(INSTALL_PROGRAM) doexec $(DESTDIR)/bin/doexec
$(INSTALL_PROGRAM) usleep $(DESTDIR)/bin/usleep
$(INSTALL_PROGRAM) ipcalc $(DESTDIR)/bin/ipcalc
$(INSTALL_PROGRAM) netreport $(DESTDIR)/sbin/netreport
$(INSTALL_PROGRAM) consoletype $(DESTDIR)/sbin/consoletype
$(INSTALL_PROGRAM) fstab-decode $(DESTDIR)/sbin/fstab-decode
$(INSTALL_PROGRAM) genhostid $(DESTDIR)/sbin/genhostid
$(INSTALL_PROGRAM) getkey $(DESTDIR)/sbin/getkey
$(INSTALL_PROGRAM) initlog $(DESTDIR)/sbin/initlog
$(INSTALL_PROGRAM) minilogd $(DESTDIR)/sbin/minilogd
$(INSTALL_PROGRAM) usernetctl $(DESTDIR)$(sbindir)/usernetctl
$(INSTALL_DATA) initlog.1 $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) genhostid.1 $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) doexec.1 $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) getkey.1 $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) netreport.1 $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) usleep.1 $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) ipcalc.1 $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) consoletype.1 $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) fstab-decode.8 $(DESTDIR)$(mandir)/man8
$(INSTALL_DATA) usernetctl.8 $(DESTDIR)$(mandir)/man8
$(INSTALL_DATA) initlog.conf $(DESTDIR)$(sysconfdir)
# install -m 2755 netreport $(DESTDIR)/sbin/netreport
# install -m 4755 usernetctl $(DESTDIR)$(sbindir)/usernetctl
clean:
rm -f $(PROGS) *.o