-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdistribute.mk.in
161 lines (147 loc) · 4.98 KB
/
distribute.mk.in
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/usr/bin/make -f
# This is a Makefile "script" that aids in creating
# releases of SciTECO.
# It is probably of little help to ordinary users.
# It is not part of the normal build process.
# Since we need the source tarball and other files
# from the source tree, this script is substituted
# by ./configure and must thus be run from some configured
# build directory.
# Distribution tarball
SCITECO_SRC = @PACKAGE@-@[email protected]
# Directory name in $(SCITECO_SRC)
SCITECO_DIR = @PACKAGE@-@VERSION@
$(SCITECO_SRC):
$(MAKE) dist
all : $(SCITECO_SRC) debian mingw-binary
# $(UBUNTU) sets the Ubuntu distribution and fixes the package's
# version
debian-prepare: debian-temp/
.PHONY: debian-temp/
debian-temp/ : $(SCITECO_SRC)
rm -rf debian-temp/
mkdir debian-temp/
(cd debian-temp/; \
cp ../$(SCITECO_SRC) \
sciteco_@[email protected]; \
tar xzf sciteco_@[email protected]; \
cp -r @abs_srcdir@/debian $(SCITECO_DIR)/; \
)
ifneq ($(UBUNTU),)
sciteco -e "@EB|debian-temp/$(SCITECO_DIR)/debian/changelog| \
<@FS/ unstable;/ $(UBUNTU);/; -@S/)/R @I/ppa1~$(UBUNTU)1/ L> \
@EW||"
endif
SIGN ?= no
ifeq ($(SIGN),yes)
DEBUILD_FLAGS :=
else
DEBUILD_FLAGS := -us -uc
endif
# Whether to upload upstream sources (dist tarball) to the PPA
# This must be YES for new releases.
# It must be NO after the tarball has been
# uploaded once, else launchpad refuses
# building the source package.
# Launchpad will also refuse new versions of the
# tar ball for the same release, so the tarball
# should NOT be cleaned when uploading for multiple
# Ubuntu versions.
# If a bug is found only during PPA building,
# the upstream version must be increased since we
# cannot upload a new tarball and adding patches to the
# Debian package would be idiotic :-(
UPLOAD_SRC ?= yes
ifeq ($(UPLOAD_SRC),yes)
DEBUILD_FLAGS += -sa
else
DEBUILD_FLAGS += -sd
endif
debian-source : debian-temp/source-stamp
debian-temp/source-stamp : debian-prepare
(cd debian-temp/$(SCITECO_DIR)/; \
debuild -S $(DEBUILD_FLAGS); \
)
touch $@
debian-binary : debian-temp/binary-stamp
debian-temp/binary-stamp : debian-prepare
(cd debian-temp/$(SCITECO_DIR)/; \
debuild -b $(DEBUILD_FLAGS); \
)
touch $@
debian : debian-source debian-binary
ppa : debian-source
(cd debian-temp/; \
dput ppa:robin-haberkorn/sciteco *.changes; \
)
# This is for testing FreeBSD port builds with Poudriere.
# We cannot build binary packages this way and there is little
# sense in distributing them.
#
# NOTE: This assumes that a fitting jail and ports tree has already
# been set up.
# We do nothing to sync the ports tree with our mirror of
# the FreeBSD port's Makefile (freebsd/Makefile) or to supply Poudriere
# with a recent tarball of SciTECO.
POUDRIERE_JAIL ?= 141amd64
poudriere:
poudriere testport -j $(POUDRIERE_JAIL) -o editors/sciteco@curses
poudriere testport -j $(POUDRIERE_JAIL) -o editors/sciteco@gtk
# Create Windows release.
# Assumes a correctly installed glib (with pkgconfig script)
# and static linking of all dependant libraries (no DLLs are
# added to the zip).
# If a win32.teco_ini exists, it is added to the release
# instead of sample.teco_ini.
# This also adds gspawn-win32-helper-console.exe to the archive
# which is required by the glib spawn functions.
# If we ever build a non-console version on Windows,
# we should include gspawn-win32-helper.exe instead.
#
# When linking in PDCursesMod/WinGUI statically, the
# environment variable PDCURSES_LIBS should be set to
# "-lpdcurses -lgdi32 -lcomdlg32 -lwinmm"
# Also, don't forget to set MINGW_UI=pdcurses-gui.
MINGW_UI=pdcurses
mingw-binary : @PACKAGE@-@[email protected]
@PACKAGE@-@[email protected] : $(SCITECO_SRC)
tar xzf $(SCITECO_SRC)
(cd $(SCITECO_DIR); \
PKG_CONFIG=i686-w64-mingw32-pkg-config \
PKG_CONFIG_LIBDIR=/usr/i686-w64-mingw32/lib/pkgconfig \
./configure --host=i686-w64-mingw32 build=i386-pc-linux-gnu \
--prefix=/usr \
--with-scitecodatadir=. \
--enable-static-executables \
--disable-dependency-tracking \
--with-interface=$(MINGW_UI) \
--disable-bootstrap \
--enable-html-manual \
CFLAGS="-g -O3 -flto" CXXFLAGS="-g -O3 -flto" \
LDFLAGS="-flto"; \
)
$(MAKE) -C $(SCITECO_DIR) \
install-strip DESTDIR=`pwd`/temp-install
rm -rf $(SCITECO_DIR)/
mkdir temp-bin/
cp -r temp-install/usr/bin/* \
temp-install/usr/share/doc/sciteco/* \
temp-bin/
cp @srcdir@/win32.teco_ini temp-bin/.teco_ini || \
cp temp-install/usr/bin/sample.teco_ini \
temp-bin/.teco_ini
cp @srcdir@/COPYING @srcdir@/ChangeLog temp-bin/
rm -rf temp-install/
cp /usr/i686-w64-mingw32/bin/gspawn-win32-helper*.exe \
temp-bin/
# Collect DLLs for all included binaries
for f in temp-bin/*.exe; do \
MINGW_BUNDLEDLLS_SEARCH_PATH=/usr/i686-w64-mingw32/bin \
@srcdir@/contrib/mingw-bundledlls --copy $$f; \
done
cd temp-bin/; zip -9 -r ../$@ .
rm -rf temp-bin/
clean:
rm -rf $(SCITECO_SRC)
rm -rf debian-temp/
rm -rf $(SCITECO_DIR)/