Created
February 17, 2020 18:55
-
-
Save xrogaan/09dae4c1cf3fa7a7f80def81e6c43441 to your computer and use it in GitHub Desktop.
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
WGET := $(shell command -v wget 2>/dev/null) | |
ATOOL := $(shell command -v atool 2>/dev/null) | |
FROM_SRC ?= 0 | |
RELEASE ?= 0 | |
FILENAME = cataclysmdda-0.D-Linux_x64-Tiles-${RELEASE}.tar.gz | |
FETCH_URL = https://github.com/CleverRaven/Cataclysm-DDA/releases/download/cdda-jenkins-b${RELEASE}/cataclysmdda-0.D-Linux_x64-Tiles-${RELEASE}.tar.gz | |
GFX = gfx/MSX++UnDeadPeopleEdition | |
TARGET_NAME = cataclysmdda-0.D-${RELEASE} | |
FROM_NAME = cataclysmdda-0.D-${FROM_SRC} | |
FROM = ../${FROM_NAME} | |
TARGET = ../${TARGET_NAME} | |
ifndef WGET | |
$(error "wget not found. Try apt-get install wget.") | |
endif | |
ifndef ATOOL | |
$(error "atool isn't installed on this system.") | |
endif | |
ifeq ($(RELEASE), 0) | |
$(error "RELEASE must be set, try 'make RELEASE=n' where n is the release version you wish to install.") | |
endif | |
ifeq ($(FROM_SRC), 0) | |
$(error "FROM_SRC must be set, use 'make FROM_SRC=x' where x is the release version currently installed.") | |
endif | |
SOURCE = $(FROM) | |
.PHONY = all | |
all: $(SOURCE) | |
@echo '>>>> all' | |
mv $(RELEASE)/$(TARGET_NAME) ../${TARGET_NAME} | |
SOURCES = $(SOURCE)/config | |
SOURCES+= $(SOURCE)/save | |
SOURCES+= $(SOURCE)/templates | |
SOURCES+= $(SOURCE)/sound | |
SOURCES+= $(SOURCE)/$(GFX) | |
$(SOURCE): $(SOURCES) | |
$(SOURCE)/gfx/%: $(RELEASE)/$(TARGET_NAME)/$(GFX) | |
@echo '>>>>> S:G:%' | |
mv --target-directory=$(<D) $@/ | |
$(SOURCE)/%: $(RELEASE)/$(TARGET_NAME) | |
@echo '>>>>> S:%' | |
mv --target-directory=$< $@ | |
$(RELEASE)/$(TARGET_NAME)/$(GFX): $(RELEASE)/$(TARGET_NAME) | |
@echo '>>>>> R:IN:GFX' | |
$(RELEASE)/$(TARGET_NAME): $(RELEASE)/$(FILENAME) | |
@echo '>>>>> R:IN' | |
$(RELEASE)/$(FILENAME): $(RELEASE) | |
@echo '>>>>> R:F' | |
echo $@ | |
wget --directory-prefix=$(RELEASE) $(FETCH_URL) | |
cd $(RELEASE) &&\ | |
aunpack -q $(FILENAME) &&\ | |
mv "cataclysmdda-0.D" $(TARGET_NAME) | |
$(RELEASE): | |
mkdir -p $(RELEASE) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment