-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
123 lines (92 loc) · 2.75 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
all::
CAT=cat
FIND=find
XARGS=xargs
SED=sed
MKDIR=mkdir -p
CP=cp
CMP=cmp -s
HTML2TXT=lynx -dump
MARKDOWN=markdown
VWORDS:=$(shell src/getversion.sh --prefix=v MAJOR MINOR PATCH)
VERSION:=$(word 1,$(VWORDS))
BUILD:=$(word 2,$(VWORDS))
## Provide a version of $(abspath) that can cope with spaces in the
## current directory.
myblank:=
myspace:=$(myblank) $(myblank)
MYCURDIR:=$(subst $(myspace),\$(myspace),$(CURDIR)/)
MYABSPATH=$(foreach f,$1,$(if $(patsubst /%,,$f),$(MYCURDIR)$f,$f))
-include $(call MYABSPATH,config.mk)
-include draw2svg-env.mk
#VERSION:=$(shell $(CAT) docs/VERSION)
CPPFLAGS += -DVERSION='"$(file <VERSION)"'
#TEXTFILES += HISTORY
TEXTFILES += VERSION
TEXTFILES += COPYING
DRAWFILES += cbook
DRAWFILES += die
DRAWFILES += home
DRAWFILES += space
DRAWFILES += sptst1
binaries.c += draw2svg
draw2svg_obj += draw2svg
draw2svg_obj += files
draw2svg_obj += indent
draw2svg_obj += theconv
draw2svg_obj += units
draw2svg_obj += version
SOURCES:=$(filter-out $(headers),$(shell $(FIND) src/obj \( -name "*.c" -o -name "*.h" \) -printf '%P\n'))
riscos_zips += draw2svg
draw2svg_zrof += !ReadMe,fff
draw2svg_apps += boot
boot_appname=!Boot
boot_rof += $(call riscos_bin,$(binaries.c))
draw2svg_apps += source
source_appname=Draw2SVG
source_rof += Extras/Sprites,ff9
source_rof += Extras/draw2svg,bae
source_rof += $(TEXTFILES:%=Docs/%,fff)
source_rof += Tests/convert,feb
source_rof += $(DRAWFILES:%=Tests/DrawFiles/%,aff)
source_rof += $(call riscos_src,$(SOURCES))
source_rof += Tests/SVGFiles
include binodeps.mk
tmp/obj/version.o: VERSION
all:: BUILD VERSION installed-binaries riscos-zips
install:: install-binaries install-riscos
tidy::
$(FIND) . -name "*~" -exec $(RM) {} \;
distclean: blank
$(RM) VERSION BUILD
out/riscos/Draw2SVG/Tests/SVGFiles:
$(MKDIR) '$@'
$(BINODEPS_OUTDIR)/riscos/Draw2SVG/Docs/VERSION,fff: VERSION
$(MKDIR) "$(@D)"
$(CP) "$<" "$@"
$(BINODEPS_OUTDIR)/riscos/!ReadMe,fff: tmp/README.html
$(MKDIR) "$(@D)"
$(HTML2TXT) "$<" > "$@"
$(BINODEPS_OUTDIR)/riscos/Draw2SVG/Docs/COPYING,fff: LICENSE.txt
$(MKDIR) "$(@D)"
$(CP) "$<" "$@"
tmp/README.html: README.md
$(MKDIR) '$(@D)'
$(MARKDOWN) '$<' > '$@'
MYCMPCP=$(CMP) -s '$1' '$2' || $(CP) '$1' '$2'
.PHONY: prepare-version
mktmp:
@$(MKDIR) tmp/
prepare-version: mktmp
$(file >tmp/BUILD,$(BUILD))
$(file >tmp/VERSION,$(VERSION))
BUILD: prepare-version
@$(call MYCMPCP,tmp/BUILD,$@)
VERSION: prepare-version
@$(call MYCMPCP,tmp/VERSION,$@)
# Set this to the comma-separated list of years that should appear in
# the licence. Do not use characters other than [0-9,] - no spaces.
YEARS=2000-1,2005-6,2012,2019
update-licence:
$(FIND) . -name ".svn" -prune -or -type f -print0 | $(XARGS) -0 \
$(SED) -i 's/Copyright (C) [0-9,-]\+ Steven Simpson/Copyright (C) $(YEARS) Steven Simpson/g'