forked from Wyrrrd/IndustrialDisplayPlates-Archive
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
26 lines (21 loc) · 766 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
SHELL := /bin/bash
MAKEFLAGS += --warn-undefined-variables
.SHELLFLAGS := -euo pipefail -c
MOD_NAME := $(shell jq -r '.name' info.json)
VERSION := $(shell jq -r '.version' info.json)
GIT_VERSION := $(shell git describe --dirty --always | sed 's/-/./2' | sed 's/-/./2')
RELEASE_NAME := $(MOD_NAME)_$(VERSION)_$(GIT_VERSION)
DIST_NAME := $(MOD_NAME)_$(VERSION)
.PHONY: clean dist sync
clean:
rm -rf dist/
dist: clean
mkdir -p dist
rsync -r --exclude-from .makeignore . dist/$(RELEASE_NAME)
cp -r dist/$(RELEASE_NAME) dist/$(DIST_NAME)
cd dist; zip -9yrm $(DIST_NAME).zip $(DIST_NAME)
sync: dist
ifndef FACTORIO_MOD_DIR
$(error FACTORIO_MOD_DIR is undefined)
endif
rsync -avr --delete dist/$(RELEASE_NAME)/ $(FACTORIO_MOD_DIR)/$(DIST_NAME)