-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (71 loc) · 2.6 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# Makefile to build KickSmash firmware, host software, and Amiga software
#
VER ?= 1.1+
MAKE ?= make
MAKEFLAGS += --no-print-directory
all: build-sw build-fw build-amiga
clean: clean-sw clean-fw clean-amiga
build-fw build-amiga build-sw:
@echo
@echo "* Building in $(@:build-%=%)"
@$(MAKE) -C $(@:build-%=%) all
clean-sw clean-fw clean-amiga:
@echo
@echo "* Cleaning in $(@:clean-%=%)"
@$(MAKE) -C $(@:clean-%=%) clean-all
# ---------------------------------------------------------------
RELEASE_DIR := kicksmash_$(VER)
RELEASE_LHA := kicksmash_$(VER).lha
RELEASE_ZIP := kicksmash_$(VER).zip
RELEASE_TARGETS :=
RELEASE_DIRS :=
define RELEASE_IT
ifneq (,$(wildcard $(1)))
RELEASE_TARGETS += $(RELEASE_DIR)/$(2)
RELEASE_DIRS += $(dir $(RELEASE_DIR)/$(2))
$(RELEASE_DIR)/$(2): $(1)
endif
endef
$(eval $(call RELEASE_IT,sw/objs.x86_64/hostsmash,sw/hostsmash.linux_x86_64))
$(eval $(call RELEASE_IT,sw/objs.mac/hostsmash,sw/hostsmash.mac))
$(eval $(call RELEASE_IT,sw/objs.armv7l/hostsmash,sw/hostsmash.pi32))
$(eval $(call RELEASE_IT,sw/objs.win32/hostsmash.exe,sw/hostsmash_win32.exe))
$(eval $(call RELEASE_IT,sw/objs.win64/hostsmash.exe,sw/hostsmash_win64.exe))
$(eval $(call RELEASE_IT,fw/objs/fw.bin,fw/fw.bin))
$(eval $(call RELEASE_IT,fw/objs/fw.elf,fw/fw.elf))
$(eval $(call RELEASE_IT,fw/Makefile.release,fw/Makefile))
$(eval $(call RELEASE_IT,fw/.gdbinit,fw/.gdbinit))
$(eval $(call RELEASE_IT,amiga/smash,amiga/smash))
$(eval $(call RELEASE_IT,amiga/smashftp,amiga/smashftp))
$(eval $(call RELEASE_IT,amiga/smashfs,amiga/smashfs))
$(eval $(call RELEASE_IT,amiga/smashfsrom,amiga/smashfsrom))
$(eval $(call RELEASE_IT,amiga/smashfsrom_d,amiga/smashfsrom_d))
$(eval $(call RELEASE_IT,amiga/romswitch,amiga/romswitch))
$(eval $(call RELEASE_IT,README.md,README.md))
$(eval $(call RELEASE_IT,LICENSE.md,LICENSE.md))
$(foreach DOC,$(wildcard doc/*),$(eval $(call RELEASE_IT,$(DOC),$(DOC))))
RELEASE_DIRS := $(sort $(RELEASE_DIR) $(RELEASE_DIRS))
ifneq (,$(wildcard $(RELEASE_LHA))$(wildcard $(RELEASE_ZIP)))
release:
@echo $(RELEASE_LHA) or $(RELEASE_ZIP) already exists
else
release: all
@$(MAKE) do_release
do_release: populating $(RELEASE_TARGETS) $(RELEASE_LHA) $(RELEASE_ZIP)
$(RELEASE_LHA): all populating $(RELEASE_TARGETS)
@echo "* Building $@"
@rm -f $@
@lha -aq2 $@ $(RELEASE_DIR)
$(RELEASE_ZIP): all populating $(RELEASE_TARGETS)
@echo "* Building $@"
@rm -f $@
@zip -rq $@ $(RELEASE_DIR)
populating:
@echo "* Populating $(RELEASE_DIR)"
$(RELEASE_TARGETS): | $(RELEASE_DIRS)
cp -p $^ $@
endif
$(RELEASE_DIRS):
mkdir -p $@
.PHONY: build-sw build-fw build-amiga clean-sw clean-fw clean-amiga all clean release populating