-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (38 loc) · 1.14 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
deps := deps
doc := doc
mod_name := worldgen_utils
mods := mods
release := release
release_name := worldgen-utils
test := test
all: doc
clean:
$(RM) -R $(doc)
.PHONY: doc
doc:
ldoc --dir=$(doc) mods/$(mod_name)
.PHONY: release
release:
# Prepare the directory structure.
mkdir -p $(release)/
mkdir -p $(release)/$(release_name)/
mkdir -p $(release)/$(release_name)/mods/
# Copy the dependencies.
cp -R $(deps)/utils/utils $(release)/$(release_name)/mods/
cp -R $(deps)/utils/worldgen_utils $(release)/$(release_name)/mods/
# Copy the mods.
cp -R $(mods)/$(mod_name) $(release)/$(release_name)/mods/
# Copy the files.
cp LICENSE $(release)/$(release_name)/
cp README $(release)/$(release_name)/
tar -c --xz -C $(release) -f $(release)/$(release_name).tar.xz $(release_name)/
tar -c --gz -C $(release) -f $(release)/$(release_name).tar.gz $(release_name)/
cd $(release); zip -r -9 $(release_name).zip $(release_name); cd -
.PHONY: update-deps
update-deps:
git submodule foreach git pull origin master
git add $(deps)/
git commit -m "Updated dependencies."
.SILENT .PHONY: test
test: $(test)/*.lua
$(foreach file,$^,lua $(file);)