diff --git a/base-codezero/Makefile b/base-codezero/Makefile index f04ea5e7d..721041d67 100644 --- a/base-codezero/Makefile +++ b/base-codezero/Makefile @@ -11,6 +11,14 @@ GIT_REV = 6fa4884a5a1cf6207372f69ae01e5faa6d5a39c8 CONTRIB_DIR = contrib PATCHES = $(shell find patches -name *.patch) +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,git) +$(call check_tool,patch) + # # Print help information by default # diff --git a/base-foc/Makefile b/base-foc/Makefile index 447dc4775..3f5b9bd5b 100644 --- a/base-foc/Makefile +++ b/base-foc/Makefile @@ -30,6 +30,14 @@ SVN_TARGETS = tools/preprocess \ l4/pkg/uclibc \ l4/pkg/libvcpu +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,patch) +$(call check_tool,svn) + # # Print help information by default # diff --git a/base-nova/Makefile b/base-nova/Makefile index 2e6ca23be..592b7158a 100644 --- a/base-nova/Makefile +++ b/base-nova/Makefile @@ -11,6 +11,14 @@ CONTRIB_DIR = contrib NOVA_ARCHIVE = nova-hypervisor-0.4.tar.bz2 NOVA_URI = http://os.inf.tu-dresden.de/~us15/nova/$(NOVA_ARCHIVE) +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,wget) +$(call check_tool,patch) + # # Print help information by default # diff --git a/base-okl4/Makefile b/base-okl4/Makefile index 40ea4d055..3470db5f5 100644 --- a/base-okl4/Makefile +++ b/base-okl4/Makefile @@ -14,6 +14,15 @@ OKL4_URI = http://wiki.ok-labs.com/downloads/release-2.1.1-patch.9/$(OKL4_A PATCHES = $(shell find patches -name *.patch) SHELL = bash +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,wget) +$(call check_tool,patch) +$(call check_tool,sed) + # # Determine python version to use for OKL4's elfweaver # diff --git a/base-pistachio/Makefile b/base-pistachio/Makefile index 5a184958d..27465a149 100644 --- a/base-pistachio/Makefile +++ b/base-pistachio/Makefile @@ -11,6 +11,17 @@ GIT_REV = 5c1b29b9c77fbd4760f35507da3d2f548f4364bd CONTRIB_DIR = contrib PATCHES = $(shell find patches -name *.patch) +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,git) +$(call check_tool,patch) +$(call check_tool,sed) +$(call check_tool,autoheader) +$(call check_tool,autoconf) + # # Print help information by default # diff --git a/dde_ipxe/Makefile b/dde_ipxe/Makefile index 07e412eb7..601dbc64e 100644 --- a/dde_ipxe/Makefile +++ b/dde_ipxe/Makefile @@ -12,6 +12,14 @@ GIT_REV = 174df77359f22f3be2169e9bb04e8018015b5e94 CONTRIB_DIR = contrib PATCH_FILE = patches/dde_ipxe.patch +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,git) +$(call check_tool,patch) + # # Print help information by default # diff --git a/dde_linux/Makefile b/dde_linux/Makefile index 5a5d58429..7221007dd 100644 --- a/dde_linux/Makefile +++ b/dde_linux/Makefile @@ -58,6 +58,14 @@ CONTENT += include/linux/input/mt.h CONTRIB_CONTENT := $(addprefix $(CONTRIB_DIR)/,$(CONTENT)) +# +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,wget) +$(call check_tool,patch) # # Print help information by default diff --git a/libports/Makefile b/libports/Makefile index ccfe6accd..fce83778d 100644 --- a/libports/Makefile +++ b/libports/Makefile @@ -22,6 +22,14 @@ SHELL = bash # prepare: $(DOWNLOAD_DIR) $(CONTRIB_DIR) +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,wget) +$(call check_tool,patch) + # # Include information about available ports # @@ -66,4 +74,3 @@ clean: $(addprefix clean-,$(PKG)) cleanall: clean $(VERBOSE)rm -rf $(DOWNLOAD_DIR) - diff --git a/libports/ports/ffat.mk b/libports/ports/ffat.mk index 093cca1c7..48631b76b 100644 --- a/libports/ports/ffat.mk +++ b/libports/ports/ffat.mk @@ -13,6 +13,11 @@ FFAT_URL = http://genode.org/files/$(FFAT_ZIP) # PORTS += ffat-0.07e +# +# Check for tools +# +$(call check_tool,unzip) + prepare-ffat: $(CONTRIB_DIR)/$(FFAT) $(CONTRIB_DIR)/$(FFAT): clean-ffat diff --git a/libports/ports/libc.mk b/libports/ports/libc.mk index c753f239c..bcdf1c557 100644 --- a/libports/ports/libc.mk +++ b/libports/ports/libc.mk @@ -6,11 +6,11 @@ LIBC := libc-8.2.0 PORTS += $(LIBC) # -# Sanity check for tools +# Check for tools # -ifeq ($(shell which lex),) -$(error Missing installation of 'lex' (package flex)) -endif +$(call check_tool,svn) +$(call check_tool,lex) +$(call check_tool,yacc) # # Subdirectories to check out from FreeBSD's Subversion repository diff --git a/libports/ports/lwip.mk b/libports/ports/lwip.mk index e5f0d2faa..c8cfa35dd 100644 --- a/libports/ports/lwip.mk +++ b/libports/ports/lwip.mk @@ -7,6 +7,11 @@ LWIP_URL = http://mirrors.zerg.biz/nongnu/lwip/$(LWIP_ZIP) # PORTS += $(LWIP) +# +# Check for tools +# +$(call check_tool,unzip) + prepare-lwip: $(CONTRIB_DIR)/$(LWIP) include/lwip/lwip include/lwip/netif $(CONTRIB_DIR)/$(LWIP): clean-lwip diff --git a/libports/ports/ncurses.mk b/libports/ports/ncurses.mk index e2ef4ee16..22b9256e8 100644 --- a/libports/ports/ncurses.mk +++ b/libports/ports/ncurses.mk @@ -7,6 +7,12 @@ NCURSES_URL := http://ftp.gnu.org/pub/gnu/ncurses/$(NCURSES_TGZ) # PORTS += $(NCURSES) +# +# Check for tools +# +$(call check_tool,sed) +$(call check_tool,mawk) + NCURSES_SYMLINKED_INC := nc_alloc.h nc_panel.h nc_tparm.h term_entry.h \ tic.h hashed_db.h capdefaults.c NCURSES_GENERATED_INC := curses.h ncurses_def.h ncurses_dll.h term.h \ diff --git a/ports-foc/Makefile b/ports-foc/Makefile index c7ef3f685..c1feeed9e 100644 --- a/ports-foc/Makefile +++ b/ports-foc/Makefile @@ -16,11 +16,20 @@ PATCH-l4android = patches/l4android_genode.patch REV-l4android = 90ca43bd629452ffd38d85fe8c976f069b5bb3d9 REPO-l4android = git://git.l4android.org/kernel.git +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,patch) + ifeq ($(TARGET), l4android) +$(call check_tool,git) DIFF = git diff UPDATE = cd $(REAL_CONTRIB_DIR)/l4android; git fetch; git reset --hard $(REV-l4android) PATCH = patch -p1 else +$(call check_tool,svn) DIFF = svn diff UPDATE = svn up -r $(REV-l4linux) $(REAL_CONTRIB_DIR)/l4linux PATCH = patch -p0 diff --git a/ports-okl4/Makefile b/ports-okl4/Makefile index 011c85dd9..ab30ec472 100644 --- a/ports-okl4/Makefile +++ b/ports-okl4/Makefile @@ -15,6 +15,15 @@ OKLX_VERSION = oklinux_2.6.23.24 OKLX_ARCHIVE = $(OKLX_VERSION).tar.gz OKLX_CONTRIB = kernel-2.6.23-v2 +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,wget) +$(call check_tool,patch) +$(call check_tool,sed) + # # Print help information by default # diff --git a/ports/Makefile b/ports/Makefile index 566d63e16..ae09696f7 100644 --- a/ports/Makefile +++ b/ports/Makefile @@ -22,6 +22,14 @@ SHELL = bash # prepare:: $(DOWNLOAD_DIR) $(CONTRIB_DIR) +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,wget) +$(call check_tool,patch) + # # Include information about available ports # diff --git a/ports/ports/vim.mk b/ports/ports/vim.mk index 945aa76ae..b5e8c8875 100644 --- a/ports/ports/vim.mk +++ b/ports/ports/vim.mk @@ -7,6 +7,11 @@ VIM_URL = ftp://ftp.vim.org/pub/vim/unix/$(VIM_TBZ2) # PORTS += $(VIM) +# +# Check for tools +# +$(call check_tool,sed) + prepare:: $(CONTRIB_DIR)/$(VIM) # diff --git a/qt4/Makefile b/qt4/Makefile index 489bd9089..d7e37e1f2 100644 --- a/qt4/Makefile +++ b/qt4/Makefile @@ -33,6 +33,14 @@ PATCHES = qt4_genode.patch \ qt4_renderwidget.patch \ qt4_include_time_h.patch +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) + +$(call check_tool,wget) +$(call check_tool,patch) + help: $(ECHO) $(ECHO) "Prepare the Qt4 repository"