-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
exomizer-3.0.2.zip | ||
exomizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
SHELL=/bin/bash | ||
|
||
VARIABLES_AT_MAKEFILE_START := $(.VARIABLES) | ||
|
||
TARGETS=build_config.inc | ||
|
||
.PHONY: all | ||
|
||
all: $(TARGETS) | ||
|
||
######################################################################## | ||
# Variables to adjust at each new integrated project | ||
######################################################################## | ||
|
||
PRODUCT_NAME=exomizer | ||
URL_RELEASE=https://bitbucket.org/magli143/exomizer/wiki/downloads/exomizer-3.0.2.zip | ||
|
||
# If the end of the URL does not make a suitable file name, set ARCHIVE_NAME to a suitable file name. | ||
# Example : URL ends in /download -> define ARCHIVE_NAME to something suitable | ||
# Example : URL ends in foo.tar.gz -> do not define ARCHIVE_NAME | ||
#ARCHIVE_NAME=$(PRODUCT_NAME)_latest.tgz | ||
|
||
# You must set EXTRACT_DIR_NAME to match archive content. | ||
EXTRACT_DIR_NAME=$(PRODUCT_NAME) | ||
|
||
# If only one generated executable file, set BUILD_TARGET_FILE to path to it. | ||
# It several generated executable files, do not set BUILD_TARGET_FILE. | ||
BUILD_DIR=$(EXTRACT_DIR_NAME)/src | ||
BUILD_TARGET_FILE=$(BUILD_DIR)/${PRODUCT_NAME} | ||
|
||
URL_DOWNLOAD=$(URL_RELEASE) | ||
|
||
ARCHIVE_NAME?=$(notdir $(URL_DOWNLOAD)) | ||
|
||
$(ARCHIVE_NAME): | ||
set -xv ; wget -S "$(URL_RELEASE)" -O $@.tmp | ||
mv -vf $@.tmp $@ | ||
@echo "************************************************************************" | ||
@echo "**************** Source archive was downloaded to: $(@)" | ||
@echo "************************************************************************" | ||
|
||
$(EXTRACT_DIR_NAME)/.unpacked: $(ARCHIVE_NAME) | ||
@echo "************************************************************************" | ||
@echo "**************** Extracting source from: $^" | ||
@echo "************************************************************************" | ||
mkdir -p $(EXTRACT_DIR_NAME) ; cd $(EXTRACT_DIR_NAME) ; unzip ../$< | ||
touch $@ | ||
@echo "************************************************************************" | ||
@echo "**************** Source extracted to: $(@D)" | ||
@echo "************************************************************************" | ||
|
||
PATCHNAME=$(EXTRACT_DIR_NAME)_build_patch.patch | ||
|
||
.PHONY: patch | ||
|
||
patch: $(EXTRACT_DIR_NAME)/.patched | ||
|
||
ifeq ($(wildcard $(PATCHNAME)),) | ||
$(EXTRACT_DIR_NAME)/.patched: $(EXTRACT_DIR_NAME)/.unpacked | ||
@echo "************************************************************************" | ||
@echo "**************** No patch to apply to: $^" | ||
@echo "************************************************************************" | ||
touch $@ | ||
@echo "************************************************************************" | ||
@echo "**************** Source patched in: $(@D)" | ||
@echo "************************************************************************" | ||
else | ||
$(EXTRACT_DIR_NAME)/.patched: $(PATCHNAME) $(EXTRACT_DIR_NAME)/.unpacked | ||
@echo "************************************************************************" | ||
@echo "**************** Patching source in: $^" | ||
@echo "************************************************************************" | ||
#patch -p0 < $< | ||
touch $@ | ||
@echo "************************************************************************" | ||
@echo "**************** Source patched in: $(@D)" | ||
@echo "************************************************************************" | ||
endif | ||
|
||
BUILD_TARGET_FILE?=$(EXTRACT_DIR_NAME)/.built | ||
|
||
$(BUILD_TARGET_FILE): $(EXTRACT_DIR_NAME)/.patched | ||
@echo "************************************************************************" | ||
@echo "**************** Configuring and build in: $^" | ||
@echo "************************************************************************" | ||
$(MAKE) -C "$(BUILD_DIR)" --print-directory | ||
touch "$@" | ||
@echo "************************************************************************" | ||
@echo "**************** Configured and built in: $(@D)" | ||
@echo "************************************************************************" | ||
|
||
build_config.inc: $(BUILD_TARGET_FILE) Makefile | ||
(set -eu ; \ | ||
{ \ | ||
echo "# with bash do \"source\" this file." ; \ | ||
echo "export EXOMIZER_ROOT=\"$${PWD}\"" ; \ | ||
cd "$(<D)" ; \ | ||
echo "export PATH=\"\$${PATH}:$$PWD\"" ; \ | ||
} >$@ ; ) | ||
|
||
#$(PRODUCT_NAME): $(BUILD_TARGET_FILE) | ||
# cp -avf $< $@ | ||
|
||
.PHONY: install | ||
|
||
install: $(BUILD_TARGET_FILE) | ||
@ if [[ -z "$PREFIX_BIN" ]] ; then echo >&2 "PREFIX_BIN not set. Aborting." ; exit 1 ; fi | ||
@echo "************************************************************************" | ||
@echo "**************** Installing: $^" | ||
@echo "************************************************************************" | ||
install -s -D -v --target-directory=$(PREFIX_BIN) $(BUILD_TARGET_FILE) | ||
@echo "************************************************************************" | ||
@echo "**************** Configured and built in: $(@D)" | ||
@echo "************************************************************************" | ||
|
||
clean: | ||
-$(MAKE) -C "$(BUILD_DIR)" clean | ||
-rm -f $(BUILD_TARGET_FILE) | ||
|
||
mrproper: | ||
-rm -f $(BUILD_TARGET_FILE) | ||
-rm -f $(TARGETS) | ||
-rm -rf $(EXTRACT_DIR_NAME) ._$(EXTRACT_DIR_NAME) *~ | ||
-rm -f $(PRODUCT_NAME) | ||
|
||
distclean: mrproper | ||
-rm -f $(ARCHIVE_NAME) | ||
|
||
######################################################################## | ||
# Debug the makefile | ||
######################################################################## | ||
$(foreach v, \ | ||
$(filter-out $(VARIABLES_AT_MAKEFILE_START) VARIABLES_AT_MAKEFILE_START,$(.VARIABLES)), \ | ||
$(info $(v) = $($(v)))) |