From 9635b455c7ba6d5a7e196ac8776fc28c6f1e03e4 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 20 Nov 2007 17:37:15 +0000 Subject: Introduce CONTENTS variable into Makefiles to list the contents of the directory, excluding the Makefile for to Make life easier --- conf.d.BSD/Makefile | 2 +- conf.d/Makefile | 3 +-- default.mk | 5 +++++ init.d.BSD/Makefile | 2 +- init.d.Linux/Makefile | 2 +- init.d/Makefile | 5 ++--- net.BSD/Makefile | 4 ++-- net.Linux/Makefile | 5 +---- net/Makefile | 5 ++--- sh.BSD/Makefile | 2 +- sh.Linux/Makefile | 2 +- 11 files changed, 18 insertions(+), 19 deletions(-) diff --git a/conf.d.BSD/Makefile b/conf.d.BSD/Makefile index b302ac0..dd2e315 100644 --- a/conf.d.BSD/Makefile +++ b/conf.d.BSD/Makefile @@ -1,5 +1,5 @@ DIR = /etc/conf.d -CONF = localmount moused net.example powerd syscons +CONF = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/conf.d/Makefile b/conf.d/Makefile index cce63f6..f26da99 100644 --- a/conf.d/Makefile +++ b/conf.d/Makefile @@ -1,6 +1,5 @@ DIR = /etc/conf.d -CONF = bootmisc checkfs clock env_whitelist hostname local.start local.stop \ - net rc urandom +CONF = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/default.mk b/default.mk index 6ec11c3..661e447 100644 --- a/default.mk +++ b/default.mk @@ -11,6 +11,11 @@ _OS_SH = u=`uname -s`; case "$${u}" in *BSD|DragonFly) echo "BSD";; *) echo "$${ _OS != $(_OS_SH) OS ?= $(_OS)$(shell $(_OS_SH)) +# We store the contents of the directory for ease of use in Makefiles +_CONTENTS_SH = ls -1 | grep -v Makefile | xargs +_CONTENTS != $(_CONTENTS_SH) +CONTENTS = $(_CONTENTS)$(shell $(_CONTENTS_SH)) + # Recursive rules # Adapted from FreeBSDs bsd.subdir.mk ECHODIR ?= true diff --git a/init.d.BSD/Makefile b/init.d.BSD/Makefile index 41bafce..c50e550 100644 --- a/init.d.BSD/Makefile +++ b/init.d.BSD/Makefile @@ -1,5 +1,5 @@ DIR = /etc/init.d -BIN = clock ipfw moused powerd rarpd rpcbind syscons sysctl syslogd +BIN = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/init.d.Linux/Makefile b/init.d.Linux/Makefile index 3ed6375..c50e550 100644 --- a/init.d.Linux/Makefile +++ b/init.d.Linux/Makefile @@ -1,5 +1,5 @@ DIR = /etc/init.d -BIN = clock consolefont keymaps modules numlock sysctl +BIN = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/init.d/Makefile b/init.d/Makefile index 19f5fb4..3b4e1a2 100644 --- a/init.d/Makefile +++ b/init.d/Makefile @@ -1,6 +1,5 @@ -DIR = /etc/init.d -BIN = bootmisc checkfs checkroot hostname local localmount \ - netmount rmnologin urandom halt.sh +DIR = /etc/init.d +BIN = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/net.BSD/Makefile b/net.BSD/Makefile index cb5d207..79e0f85 100644 --- a/net.BSD/Makefile +++ b/net.BSD/Makefile @@ -1,5 +1,5 @@ -DIR = $(RC_LIB)/net -CONF = ifconfig.sh iwconfig.sh +DIR = $(RC_LIB)/net +CONF = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/net.Linux/Makefile b/net.Linux/Makefile index 40c40f2..79e0f85 100644 --- a/net.Linux/Makefile +++ b/net.Linux/Makefile @@ -1,8 +1,5 @@ DIR = $(RC_LIB)/net -CONF = adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \ - ccwgroup.sh clip.sh ifconfig.sh ifplugd.sh ip6to4.sh ipppd.sh \ - iproute2.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh \ - udhcpc.sh vlan.sh +CONF = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/net/Makefile b/net/Makefile index 017f4e5..79e0f85 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1,6 +1,5 @@ -DIR = $(RC_LIB)/net -CONF = dhclient.sh dhcpcd.sh macchanger.sh macnet.sh ssidnet.sh system.sh \ - wpa_supplicant.sh +DIR = $(RC_LIB)/net +CONF = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/sh.BSD/Makefile b/sh.BSD/Makefile index ec4ffa2..19b68f3 100644 --- a/sh.BSD/Makefile +++ b/sh.BSD/Makefile @@ -1,5 +1,5 @@ DIR = $(RC_LIB)/sh -BIN = init.sh +BIN = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk diff --git a/sh.Linux/Makefile b/sh.Linux/Makefile index b6592c4..19b68f3 100644 --- a/sh.Linux/Makefile +++ b/sh.Linux/Makefile @@ -1,5 +1,5 @@ DIR = $(RC_LIB)/sh -BIN = init.sh init-early.sh +BIN = $(CONTENTS) TOPDIR = .. include $(TOPDIR)/default.mk -- cgit v1.2.3