dde_ipxe: migrate to new ports mechanism

Issue #1082
This commit is contained in:
Josef Söntgen 2014-05-20 17:02:39 +02:00 committed by Norman Feske
parent d1e10e939d
commit 313202fb65
6 changed files with 37 additions and 65 deletions

View File

@ -1,67 +1,25 @@
#
# \brief Fetch and patch iPXE source code
# \author Stefan Kalkowski
# \author Christian Helmuth
# \date 2011-08-12
# \brief Download, and unpack iPXE
# \author Josef Soentgen
# \date 2014-05-20
#
VERBOSE ?= @
ECHO = @echo
GIT_URL = http://git.ipxe.org/ipxe.git
GIT_REV = c4bce43c3c4d3c5ebb2d926b58ad16dc9642c19d
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)
VERBOSE ?= @
ECHO := @echo
#
# Print help information by default
#
help:
help::
prepare:
$(VERBOSE)../../tool/ports/prepare_port dde_ipxe CHECK_HASH=no
help::
$(ECHO)
$(ECHO) "Prepare the dde_ipxe repository"
$(ECHO)
$(ECHO) "--- available commands ---"
$(ECHO) "prepare - fetch and patch iPXE source code"
$(ECHO) "clean - revert patch from iPXE souce code"
$(ECHO) "cleanall - remove iPXE souce code"
$(ECHO) "update-patch - updates patch for iPXE source code"
$(ECHO) "prepare - checkout upstream source codes"
$(ECHO)
$(CONTRIB_DIR)/.git:
$(VERBOSE)git clone $(GIT_URL) $(CONTRIB_DIR)
fetch: $(CONTRIB_DIR)/.git
$(VERBOSE)cd $(CONTRIB_DIR); git fetch origin
prepare: fetch clean
$(ECHO) "apply patch to '$(CONTRIB_DIR)/'"
$(VERBOSE)patch -p1 -d $(CONTRIB_DIR) -i $(realpath $(PATCH_FILE))
$(ECHO)
$(ECHO) "Preparation completed!"
$(ECHO) "Hint: don't forget to put '$(shell pwd)' "
$(ECHO) " as a repository into your build.conf"
$(ECHO)
update-patch:
$(ECHO) "producing a new diff and save it to '$(PATCH_FILE)'"
$(VERBOSE)(cd $(CONTRIB_DIR); LC_COLLATE=C git diff) > $(PATCH_FILE) || true
# $(VERBOSE)(cd $(CONTRIB_DIR); LC_COLLATE=C git diff) \
# | sed "s/\(^--- [^\t]*\).*/\\1/" \
# | sed "s/\(^+++ [^\t]*\).*/\\1/" \
# > $(PATCH_FILE) || true
clean:
$(VERBOSE)cd $(CONTRIB_DIR); git reset --hard $(GIT_REV)
$(VERBOSE)cd $(CONTRIB_DIR); git ls-files -o | xargs rm -rf
cleanall:
$(VERBOSE)rm -rf $(CONTRIB_DIR)
.PHONY: cleanall clean update-patch prepare fetch help

View File

@ -1,5 +1,5 @@
LIB_DIR := $(REP_DIR)/src/lib/dde_ipxe
CONTRIB_DIR := $(REP_DIR)/contrib/src
LIB_DIR := $(REP_DIR)/src/lib/dde_ipxe
IPXE_CONTRIB_DIR := $(call select_from_ports,dde_ipxe)/src/lib/dde_ipxe/src
LIBS = dde_kit dde_ipxe_support
@ -14,9 +14,10 @@ SRC_C += $(addprefix drivers/bitbash/, bitbash.c spi_bit.c)
SRC_C += $(addprefix drivers/nvs/, nvs.c threewire.c)
SRC_C += $(addprefix drivers/net/, pcnet32.c intel.c eepro100.c realtek.c mii.c)
INC_DIR += $(LIB_DIR)/include \
$(CONTRIB_DIR)/include $(CONTRIB_DIR) \
$(CONTRIB_DIR)/arch/x86/include
INC_DIR += $(LIB_DIR)/include
INC_DIR += $(IPXE_CONTRIB_DIR)/include $(IPXE_CONTRIB_DIR) \
$(IPXE_CONTRIB_DIR)/arch/x86/include
CC_WARN = -Wall -Wno-address
CC_OPT += $(addprefix -fno-builtin-, putchar toupper tolower)
@ -35,6 +36,6 @@ vpath nic.c $(LIB_DIR)
vpath dde.c $(LIB_DIR)
vpath dummies.c $(LIB_DIR)
vpath %.c $(CONTRIB_DIR)
vpath %.c $(IPXE_CONTRIB_DIR)
# vi: set ft=make :

View File

@ -1,4 +1,4 @@
include $(REP_DIR)/lib/mk/dde_ipxe_nic.inc
INC_DIR += $(CONTRIB_DIR)/arch/i386/include \
$(CONTRIB_DIR)/arch/i386/include/pcbios
INC_DIR += $(IPXE_CONTRIB_DIR)/arch/i386/include \
$(IPXE_CONTRIB_DIR)/arch/i386/include/pcbios

View File

@ -1,7 +1,7 @@
include $(REP_DIR)/lib/mk/dde_ipxe_nic.inc
INC_DIR += $(CONTRIB_DIR)/arch/x86_64/include \
$(CONTRIB_DIR)/arch/x86_64/include/efi
INC_DIR += $(IPXE_CONTRIB_DIR)/arch/x86_64/include \
$(IPXE_CONTRIB_DIR)/arch/x86_64/include/efi
# take remaining parts from i386
INC_DIR += $(CONTRIB_DIR)/arch/i386/include
INC_DIR += $(IPXE_CONTRIB_DIR)/arch/i386/include

View File

@ -0,0 +1 @@
dummy

View File

@ -0,0 +1,12 @@
LICENSE := GPLv2
VERSION := git
DOWNLOADS := ipxe.git
URL(ipxe) := http://git.ipxe.org/ipxe.git
REV(ipxe) := c4bce43c3c4d3c5ebb2d926b58ad16dc9642c19d
DIR(ipxe) := src/lib/dde_ipxe
PATCHES := patches/dde_ipxe.patch
PATCH_OPT := -p1 -d ${DIR(ipxe)}
# vi: set ft=make :