consolodate Makefiles

The tree contained many operating system specific Makefiles which were
being included in other Makefiles. This commit removes those and adds
the code to the makefiles which included them using make's conditional
processing.

X-Gentoo-Bug: 387441
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=387441
This commit is contained in:
William Hubbs 2011-10-17 20:18:39 -05:00
parent 9f95878bbd
commit ecf77254bb
33 changed files with 167 additions and 128 deletions

View File

@ -6,7 +6,16 @@ CLEANFILES+= network staticroute
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
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
include ${MK}/scripts.mk
SOS?= BSD

View File

@ -1 +0,0 @@
CONF+= ipfw moused powerd rarpd savecore syscons

View File

@ -1,2 +0,0 @@
CONF+= consolefont dmesg hwclock keymaps killprocs modules
SOS= Linux

View File

@ -1 +0,0 @@
CONF+= moused rarpd savecore

View File

@ -3,5 +3,25 @@ INC= net.example
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
ifeq ($(OS),FreeBSD)
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${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,5 +0,0 @@
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${CP} $< $@

View File

@ -1,5 +0,0 @@
SRCS+= net.example.in
.SUFFIXES: .Linux.in
.Linux.in:
${CP} $< $@

View File

@ -1,5 +0,0 @@
SRCS+= net.example.in
.SUFFIXES: .BSD.in
.BSD.in:
${CP} $< $@

View File

@ -5,7 +5,21 @@ CLEANFILES+= rc.conf
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
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
include ${MK}/scripts.mk
# We can't use "ifndef" here because that treats set-but-empty

View File

@ -1,4 +0,0 @@
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

View File

@ -1,2 +0,0 @@
SED_EXTRA= -e 's:@TERM@:wsvt25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in

View File

@ -1,3 +0,0 @@
SED_EXTRA= -e 's:@TERM@:wsvt25:g'
SRCS+= rc.conf.in rc.in rc.shutdown.in
BIN+= rc rc.shutdown

View File

@ -8,4 +8,11 @@ MK= ../mk
SED_EXTRA+= -e 's:@VARBASE@:/var:g'
include ${MK}/scripts.mk
include Makefile.${OS}
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 +0,0 @@
PKG_PREFIX?= /usr/local

View File

@ -1 +0,0 @@
PKG_PREFIX?=/usr

View File

@ -1 +0,0 @@
PKG_PREFIX?= /usr/pkg

View File

@ -16,7 +16,46 @@ TARGETS+= ${_NET_LO}
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
ifeq ($(OS),FreeBSD)
NET_LO= net.lo0
# Generic BSD scripts
SRCS+= 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 \
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
# Generic BSD scripts
SRCS+= 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
.SUFFIXES: .BSD.in
.BSD.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@
endif
include ${MK}/scripts.mk
_installafter_: realinstall

View File

@ -1,13 +0,0 @@
NET_LO= net.lo0
# Generic BSD scripts
SRCS+= 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 \
powerd.in syscons.in
.SUFFIXES: .BSD.in
.BSD.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@

View File

@ -1,9 +0,0 @@
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} $< > $@

View File

@ -1,12 +0,0 @@
NET_LO= net.lo0
# Generic BSD scripts
SRCS+= 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
.SUFFIXES: .BSD.in
.BSD.in:
sed ${SED_REPLACE} ${SED_EXTRA} $< > $@

View File

@ -5,5 +5,30 @@ INC= dhclient.sh dhcpcd.sh ifconfig.sh macchanger.sh macnet.sh \
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
ifeq ($(OS),FreeBSD)
SRCS+= iwconfig.sh.in
INC+= 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 \
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
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${CP} $< $@
endif
include ${MK}/scripts.mk

View File

@ -1,6 +0,0 @@
SRCS+= iwconfig.sh.in
INC+= iwconfig.sh
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${CP} $< $@

View File

@ -1,9 +0,0 @@
SRCS+= iwconfig.sh.in
INC+= 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} $< $@

View File

@ -1,5 +0,0 @@
INC+= ifwatchd.sh
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${CP} $< $@

View File

@ -15,7 +15,26 @@ MK= ../mk
include ${MK}/sys.mk
include ${MK}/os.mk
include ${MK}/gitignore.mk
include Makefile.${OS}
ifeq ($(OS),BSD)
BOOT+= hostid newsyslog savecore syslogd swap-blk
else ifeq ($(OS),FreeBSD)
# Generic BSD stuff
BOOT+= 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
# NetBSD specific stuff
BOOT+= devdb swap-blk ttys wscons
endif
all:

View File

@ -1 +0,0 @@
BOOT+= hostid newsyslog savecore syslogd swap-blk

View File

@ -1,5 +0,0 @@
# Generic BSD stuff
BOOT+= hostid net.lo0 newsyslog savecore syslogd
# FreeBSD specific stuff
BOOT+= adjkerntz dumpon syscons

View File

@ -1,3 +0,0 @@
SYSINIT+= devfs dmesg
BOOT+= hwclock keymaps modules mtab procfs termencoding
SHUTDOWN+= killprocs mount-ro

View File

@ -1,5 +0,0 @@
# Generic BSD stuff
BOOT+= hostid net.lo0 newsyslog savecore syslogd
# NetBSD specific stuff
BOOT+= devdb swap-blk ttys wscons

View File

@ -8,7 +8,33 @@ INSTALLAFTER= _installafter
MK= ../mk
include ${MK}/os.mk
include Makefile.${OS}
ifeq ($(OS),FreeBSD)
SRCS+= init.sh.in
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
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
include ${MK}/scripts.mk
_installafter:

View File

@ -1,6 +0,0 @@
SRCS+= init.sh.in
.SUFFIXES: .sh.BSD.in
.sh.BSD.in.sh:
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@

View File

@ -1,7 +0,0 @@
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} $< > $@

View File

@ -1,8 +0,0 @@
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} $< > $@