forked from mintty/mintty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
146 lines (117 loc) · 4.58 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Interesting make targets:
# - exe: Just the executable. This is the default.
# - tar: Source tarball.
# - zip: Zip for standalone release.
# - pkg: Cygwin package.
# - html: HTML version of the manual page.
# - pdf: PDF version of the manual page.
# - clean: Delete generated files.
# - upload: Upload cygwin packages for publishing.
# - ann: Create cygwin announcement mail.
# - _: Create language translation template, update translation files.
# Variables intended for setting on the make command line.
# - RELEASE: release number for packaging
# - TARGET: target triple for cross compiling
# To add a file to the distribution:
# src: add to make variable below: arch_files += ...
# bin: add to cygwin/mintty.cygport
NAME := mintty
exe:
#cd src; $(MAKE) exe
#cd src; $(MAKE) bin
cd src; $(MAKE)
zip:
cd src; $(MAKE) zip
html: docs/$(NAME).1.html
pdf:
cd src; $(MAKE) pdf
clean:
cd src; $(MAKE) clean
version := \
$(shell echo $(shell echo VERSION | cpp -P $(CPPFLAGS) --include src/appinfo.h))
name_ver := $(NAME)-$(version)
changelogversion := $(shell sed -e '1 s,^\#* *\([0-9.]*\).*,\1,' -e t -e d wiki/Changelog.md)
ver:
echo checking same version in changelog and source
test "$(version)" = "$(changelogversion)"
echo $(version) > VERSION
DIST := release
TARUSER := --owner=root --group=root --owner=mintty --group=cygwin
arch_files := Makefile LICENSE* INSTALL VERSION
arch_files += src/Makefile src/*.c src/*.h src/*.rc src/*.mft
arch_files += src/[!_]*.t src/mk*
arch_files += tools/mintheme tools/getemojis
arch_files += lang/*.pot lang/*.po
arch_files += themes/*[!~] sounds/*.wav sounds/*.WAV sounds/*.md
arch_files += cygwin/*.cygport cygwin/README cygwin/setup.hint cygwin/mintty-debuginfo.hint
arch_files += docs/*.1 docs/*.html icon/*
arch_files += wiki/*
#arch_files += scripts/*
generated := docs/$(NAME).1.html
docs/$(NAME).1.html: docs/$(NAME).1
cd src; $(MAKE) html
cp docs/$(NAME).1.html mintty.github.io/
src := $(DIST)/$(name_ver).tar.gz
tar: $(generated) $(src)
$(src): $(arch_files)
mkdir -p $(DIST)
rm -rf $(name_ver)
mkdir $(name_ver)
#cp -ax --parents $^ $(name_ver)
cp -dl --parents $^ $(name_ver)
rm -f $@
tar czf $@ --exclude="*~" $(TARUSER) $(name_ver)
rm -rf $(name_ver)
REL := 1
arch := $(shell uname -m)
cygport := $(name_ver)-$(REL).cygport
pkg: $(DIST) ver cop tar check _ srcpkg binpkg
$(DIST):
mkdir $(DIST)
check:
cd src; $(MAKE) check
cop:
grep YEAR.*`date +%Y` src/appinfo.h
_:
cd src; $(MAKE) _
binpkg:
cp cygwin/mintty.cygport $(DIST)/$(cygport)
cd $(DIST); cygport $(cygport) prep
cd $(DIST); cygport $(cygport) compile install
# cygport packages would reveal user information;
# with $$(TARUSER) in $${TAR_OPTIONS}, they are reduced to numeric,
# but strangely still the local ids:
#cd $(DIST); TAR_OPTIONS="$(TARUSER)" cygport $(cygport) package
# this succeeds to record owner/group "0/0" in the archives:
#cd $(DIST); TAR_OPTIONS="--owner=0 --group=0" cygport $(cygport) package
# but we've already established the explicit archive build,
# which records owner/group "mintty/cygwin" in the archives:
# binary package:
cd $(DIST)/$(name_ver)-$(REL).$(arch)/inst; tar cJf ../$(name_ver)-$(REL).tar.xz $(TARUSER) usr/bin etc usr/share
# debug package:
cd $(DIST)/$(name_ver)-$(REL).$(arch)/inst; tar cJf ../$(NAME)-debuginfo-$(version)-$(REL).tar.xz $(TARUSER) usr/lib/debug usr/src/debug
srcpkg: $(DIST)/$(name_ver)-$(REL)-src.tar.xz
# deprecated:
#$(DIST)/$(name_ver)-$(REL)-src.tar.xz: $(DIST)/$(name_ver)-src.tar.bz2
# cp cygwin/mintty.cygport $(DIST)/$(cygport)
# cd $(DIST); tar cJf $(name_ver)-$(REL)-src.tar.xz $(TARUSER) $(name_ver)-src.tar.bz2 $(name_ver)-$(REL).cygport
# let's make the source package a .tar.gz (not -src.tar.bz2) to be
# consistent with github and support cygport magic package name handling:
$(DIST)/$(name_ver)-$(REL)-src.tar.xz: $(DIST)/$(name_ver).tar.gz
cp cygwin/mintty.cygport $(DIST)/$(cygport)
cd $(DIST); tar cJf $(name_ver)-$(REL)-src.tar.xz $(TARUSER) $(name_ver).tar.gz $(name_ver)-$(REL).cygport
upload:
REL=$(REL) cygwin/upload.sftp
announcement=cygwin/announcement.$(version)
ann: announcement
announcement:
echo To: [email protected] > $(announcement)
echo Subject: Updated: mintty $(version) >> $(announcement)
echo >> $(announcement)
echo I have uploaded mintty $(version) with the following changes: >> $(announcement)
sed -n -e 1d -e "/^#/ q" -e p wiki/Changelog.md >> $(announcement)
echo The homepage is at http://mintty.github.io/ >> $(announcement)
echo It also links to the issue tracker. >> $(announcement)
echo >> $(announcement)
echo ------ >> $(announcement)
echo Thomas >> $(announcement)