further clean up OS differences in makefiles

No need for if() logic.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2011-10-19 21:30:39 -04:00 committed by William Hubbs
parent 9c77502f96
commit 9a539ebbe1
15 changed files with 93 additions and 149 deletions

View File

@ -1,5 +1,6 @@
DIR= ${CONFDIR}
CONF= bootmisc fsck hostname localmount network staticroute urandom
CONF= bootmisc fsck hostname localmount network staticroute urandom \
${CONF-${OS}}
TARGETS+= network staticroute
CLEANFILES+= network staticroute
@ -7,22 +8,16 @@ CLEANFILES+= network staticroute
MK= ../mk
include ${MK}/os.mk
ifeq (${OS},FreeBSD)
CONF+= ipfw moused powerd rarpd savecore syscons
else ifeq (${OS},Linux)
CONF+= consolefont dmesg hwclock keymaps killprocs modules
SOS= Linux
else ifeq (${OS},NetBSD)
CONF+= moused rarpd savecore
endif
CONF-FreeBSD= ipfw moused powerd rarpd savecore syscons
CONF-Linux= consolefont dmesg hwclock keymaps killprocs modules
CONF-NetBSD= moused rarpd savecore
include ${MK}/scripts.mk
SOS?= BSD
network: network.in network${SFX}
cat $^ > $@
network: network.in network.${SOS}
cp $@.in $@
[ -e $@.${SOS} ] && cat $@.${SOS} >> $@ || true
staticroute: staticroute.${SOS}
cp $@.${SOS} $@
staticroute: staticroute${SFX}
cp $@${SFX} $@

View File

@ -1,27 +1,11 @@
DIR= ${DOCDIR}/openrc
SRCS= net.example.in
INC= net.example
MK= ../mk
include ${MK}/os.mk
ifeq (${OS},FreeBSD)
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${SFX}:
${CP} $< $@
else ifeq (${OS},Linux)
SRCS+= net.example.in
.SUFFIXES: .Linux.in
.Linux.in:
${CP} $< $@
else ifeq (${OS},NetBSD)
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${CP} $< $@
endif
include ${MK}/scripts.mk

View File

@ -1,24 +1,26 @@
DIR= ${SYSCONFDIR}
CONF= rc.conf
SRCS= rc.conf.in rc.in rc.shutdown.in
BIN= ${BIN-${OS}}
CONF= rc.conf ${BIN-${OS}}
CLEANFILES+= rc.conf
MK= ../mk
include ${MK}/os.mk
ifeq (${OS},FreeBSD)
SED_EXTRA= -e 's:@TERM@:cons25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in
CONF+= devd.conf
BIN+= rc rc.shutdown rc.devd
else ifeq (${OS},Linux)
SED_EXTRA= -e 's:@TERM@:wsvt25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in
else ifeq (${OS},NetBSD)
SED_EXTRA= -e 's:@TERM@:wsvt25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in
BIN+= rc rc.shutdown
endif
SED_EXTRA-FreeBSD= -e 's:@TERM@:cons25:g'
BIN-FreeBSD= rc rc.shutdown rc.devd
CONF-FreeBSD= devd.conf
SED_EXTRA-Linux= -e 's:@TERM@:wsvt25:g'
BIN-Linux=
CONF-Linux=
SED_EXTRA-NetBSD= -e 's:@TERM@:wsvt25:g'
BIN-NetBSD= rc rc.shutdown
CONF-NetBSD=
SED_EXTRA= ${SED_EXTRA-${OS}}
include ${MK}/scripts.mk

View File

@ -7,12 +7,5 @@ MK= ../mk
SED_EXTRA+= -e 's:@VARBASE@:/var:g'
include ${MK}/os.mk
include ${MK}/scripts.mk
ifeq ($(OS),FreeBSD)
PKG_PREFIX?= /usr/local
else ifeq ($(OS),Linux)
PKG_PREFIX?=/usr
else ifeq ($(OS),NetBSD)
PKG_PREFIX?= /usr/pkg
endif

View File

@ -1,7 +1,7 @@
DIR= ${INITDIR}
SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
network.in root.in savecache.in staticroute.in swap.in swclock.in \
sysctl.in urandom.in
sysctl.in urandom.in ${SRCS-${OS}}
BIN= ${OBJS}
# Build our old net foo or not
@ -17,44 +17,28 @@ TARGETS+= ${_NET_LO}
MK= ../mk
include ${MK}/os.mk
ifeq ($(OS),FreeBSD)
NET_LO= net.lo0
NET_LO-FreeBSD= net.lo0
# Generic BSD scripts
SRCS+= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
SRCS-FreeBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in syslogd.in
# These are FreeBSD specific
SRCS+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in ipfw.in mixer.in nscd.in \
powerd.in syscons.in
.SUFFIXES: .BSD.in
.BSD.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
else ifeq ($(OS),Linux)
NET_LO= net.lo
SRCS+= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in killprocs.in \
modules.in mount-ro.in mtab.in numlock.in procfs.in sysfs.in \
termencoding.in
.SUFFIXES: .Linux.in
.Linux.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
else ifeq ($(OS),NetBSD)
NET_LO= net.lo0
NET_LO-Linux= net.lo
SRCS-Linux= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in \
killprocs.in modules.in mount-ro.in mtab.in numlock.in \
procfs.in sysfs.in termencoding.in
NET_LO-NetBSD= net.lo0
# Generic BSD scripts
SRCS+= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
SRCS-NetBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \
rpcbind.in savecore.in syslogd.in
# These are NetBSD specific
SRCS+= devdb.in swap-blk.in ttys.in wscons.in
SRCS-NetBSD+= devdb.in swap-blk.in ttys.in wscons.in
.SUFFIXES: .BSD.in
.BSD.in:
${SFX}:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
endif
include ${MK}/scripts.mk

View File

@ -3,4 +3,7 @@
# Generic definitions
PKG_PREFIX?= /usr/local
SFX= .BSD.in
LIBKVM?= -lkvm

View File

@ -1,5 +1,8 @@
# Copyright (c) 2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
SFX= .Linux.in
PKG_PREFIX?= /usr
CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=600
LIBDL= -Wl,-Bdynamic -ldl

View File

@ -10,3 +10,5 @@ include ${MK}/os-${OS}.mk
RC_LIB= /$(LIBNAME)/rc
SFX:= ${SFX_PFX}${SFX}
.SUFFIXES: ${SFX}

View File

@ -1,34 +1,24 @@
DIR= ${LIBEXECDIR}/net
SRCS= ifconfig.sh.in
SRCS= ifconfig.sh.in ${SRCS-${OS}}
INC= dhclient.sh dhcpcd.sh ifconfig.sh macchanger.sh macnet.sh \
ssidnet.sh system.sh wpa_supplicant.sh
ssidnet.sh system.sh wpa_supplicant.sh ${INC-${OS}}
MK= ../mk
include ${MK}/os.mk
ifeq (${OS},FreeBSD)
SRCS+= iwconfig.sh.in
INC+= iwconfig.sh
SRCS-FreeBSD= iwconfig.sh.in
INC-FreeBSD= iwconfig.sh
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${CP} $< $@
else ifeq (${OS},Linux)
SRCS+= iwconfig.sh.in
INC+= adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \
SRCS-Linux= iwconfig.sh.in
INC-Linux= adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \
ccwgroup.sh clip.sh ethtool.sh iproute2.sh ifplugd.sh ip6to4.sh \
ipppd.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh udhcpc.sh \
vlan.sh
.SUFFIXES: .sh.Linux.in
.sh.Linux.in.sh:
${CP} $< $@
else ifeq (${OS},NetBSD)
INC+= ifwatchd.sh
SRCS-NetBSD=
INC-NetBSD= ifwatchd.sh
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${SFX}.sh:
${CP} $< $@
endif
include ${MK}/scripts.mk

View File

@ -1,7 +1,8 @@
BOOT= bootmisc fsck hostname localmount network \
root staticroute swap sysctl urandom
root staticroute swap sysctl urandom ${BOOT-${OS}}
DEFAULT= local netmount
SHUTDOWN= savecache
SHUTDOWN= savecache ${SHUTDOWN-${OS}}
SYSINIT= ${SYSINIT-${OS}}
LEVELDIR= ${DESTDIR}/${SYSCONFDIR}/runlevels
SYSINITDIR= ${LEVELDIR}/sysinit
@ -16,25 +17,25 @@ include ${MK}/sys.mk
include ${MK}/os.mk
include ${MK}/gitignore.mk
ifeq (${OS},BSD)
BOOT+= hostid newsyslog savecore syslogd swap-blk
else ifeq (${OS},FreeBSD)
# Generic BSD stuff
BOOT+= hostid net.lo0 newsyslog savecore syslogd
BOOT-${OS}=
SHUTDOWN-${OS}=
SYSINIT-${OS}=
BOOT-BSD= hostid newsyslog savecore syslogd swap-blk
# Generic BSD stuff
BOOT-FreeBSD= hostid net.lo0 newsyslog savecore syslogd
# FreeBSD specific stuff
BOOT+= adjkerntz dumpon syscons
else ifeq (${OS},Linux)
SYSINIT+= devfs dmesg
BOOT+= hwclock keymaps modules mtab procfs termencoding
SHUTDOWN+= killprocs mount-ro
else ifeq (${OS},NetBSD)
# Generic BSD stuff
BOOT+= hostid net.lo0 newsyslog savecore syslogd
BOOT-FreeBSD+= adjkerntz dumpon syscons
BOOT-Linux= hwclock keymaps modules mtab procfs termencoding
SHUTDOWN-Linux= killprocs mount-ro
SYSINIT-Linux= devfs dmesg
# Generic BSD stuff
BOOT-NetBSD= hostid net.lo0 newsyslog savecore syslogd
# NetBSD specific stuff
BOOT+= devdb swap-blk ttys wscons
endif
BOOT-NetBSD+= devdb swap-blk ttys wscons
all:

View File

@ -1,42 +1,29 @@
DIR= ${LIBEXECDIR}/sh
SRCS= functions.sh.in gendepends.sh.in init-common-post.sh.in \
rc-functions.sh.in runscript.sh.in
SRCS= init.sh.in functions.sh.in gendepends.sh.in init-common-post.sh.in \
rc-functions.sh.in runscript.sh.in ${SRCS-${OS}}
INC= init-common-post.sh rc-mount.sh functions.sh rc-functions.sh
BIN= gendepends.sh init.sh runscript.sh
BIN= gendepends.sh init.sh runscript.sh ${BIN-${OS}}
INSTALLAFTER= _installafter
SFX_PFX= .sh
MK= ../mk
include ${MK}/os.mk
ifeq (${OS},FreeBSD)
SRCS+= init.sh.in
SRCS-FreeBSD=
BIN-FreeBSD=
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
SRCS-Linux= init-early.sh.in udhcpc-hook.sh.in
BIN-Linux= init-early.sh udhcpc-hook.sh
else ifeq (${OS},Linux)
SRCS+= init.sh.in init-early.sh.in udhcpc-hook.sh.in
BIN+= init-early.sh udhcpc-hook.sh
.SUFFIXES: .sh.Linux.in
.sh.Linux.in.sh:
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
else ifeq (${OS},NetBSD)
SRCS+= init.sh.in
SRCS+= ifwatchd-carrier.sh.in ifwatchd-nocarrier.sh.in
BIN+= ifwatchd-carrier.sh ifwatchd-nocarrier.sh
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
endif
SRCS-NetBSD= ifwatchd-carrier.sh.in ifwatchd-nocarrier.sh.in
BIN-NetBSD= ifwatchd-carrier.sh ifwatchd-nocarrier.sh
include ${MK}/scripts.mk
${SFX}.sh:
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
_installafter:
${INSTALL} -d ${DESTDIR}/${INITDIR}
@# Put functions.sh into init for backwards compat