Skip to content

Commit

Permalink
distribution helper script: let it be preprocessed/substituted by Aut…
Browse files Browse the repository at this point in the history
…oconf

 * makes sense since it already extracted information from ./configure
   that is usually substituted.
 * it already had to be run from a configured build directory
 * it required the source tree directory, which had to be overwritten
   on the Make command line when using an out-of-source build dir.
   This is no longer necessary.
 * It is still a stand-alone Makefile to keep it isolated from the main
   build system, although it could certainly be translated to Automake.
 * the generated file will now be called distribute.mk to signify
   that it is a Makefile.
  • Loading branch information
rhaberkorn committed Feb 16, 2016
1 parent 7ee385b commit c9c6e63
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -18,6 +18,7 @@
Makefile
Makefile.in
stamp-*
/distribute.mk

# Autotest
/tests/package.m4
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -339,7 +339,7 @@ AC_ARG_ENABLE(static-executables,
[static_executables=$enableval], [static_executables=no])
AM_CONDITIONAL(STATIC_EXECUTABLES, [test x$static_executables = xyes])

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile distribute.mk])
AC_CONFIG_FILES([src/Makefile src/interface-gtk/Makefile src/interface-curses/Makefile])
AC_CONFIG_FILES([lib/Makefile])
AC_CONFIG_FILES([doc/Makefile doc/Doxyfile])
Expand Down
49 changes: 26 additions & 23 deletions distribute → distribute.mk.in 100755 → 100644
@@ -1,14 +1,17 @@
#!/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.

# Overwrite, if building out-of-tree.
SRCDIR=.
ABS_SRCDIR=$(abspath $(SRCDIR))

# Try to extract version from ./configure
SCITECO_VERSION = $(shell $(SRCDIR)/configure --version | \
sed -n 's/SciTECO configure //p')

SCITECO_SRC = sciteco-$(SCITECO_VERSION).tar.gz
# Distribution tarball
SCITECO_SRC = @PACKAGE@-@VERSION@.tar.gz
# Directory name in $(SCITECO_SRC)
SCITECO_DIR = @PACKAGE@-@VERSION@

$(SCITECO_SRC):
$(MAKE) dist
Expand All @@ -24,12 +27,12 @@ debian-temp/ : $(SCITECO_SRC)
mkdir debian-temp/
(cd debian-temp/; \
cp ../$(SCITECO_SRC) \
sciteco_$(SCITECO_VERSION).orig.tar.gz; \
tar xzf sciteco_$(SCITECO_VERSION).orig.tar.gz; \
cp -r $(ABS_SRCDIR)/debian sciteco-$(SCITECO_VERSION)/; \
sciteco_@PACKAGE_VERSION@.orig.tar.gz; \
tar xzf sciteco_@PACKAGE_VERSION@.orig.tar.gz; \
cp -r @abs_srcdir@/debian $(SCITECO_DIR)/; \
)
ifneq ($(UBUNTU),)
sciteco -e "@EB|debian-temp/sciteco-$(SCITECO_VERSION)/debian/changelog| \
sciteco -e "@EB|debian-temp/$(SCITECO_DIR)/debian/changelog| \
<@FS/ unstable;/ $(UBUNTU);/; -@S/)/R @I/ppa1~$(UBUNTU)1/ L> \
@EW||"
endif
Expand Down Expand Up @@ -63,14 +66,14 @@ endif

debian-source : debian-temp/source-stamp
debian-temp/source-stamp : debian-prepare
(cd debian-temp/sciteco-$(SCITECO_VERSION)/; \
(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-$(SCITECO_VERSION)/; \
(cd debian-temp/$(SCITECO_DIR)/; \
debuild -b $(DEBUILD_FLAGS); \
)
touch $@
Expand Down Expand Up @@ -98,10 +101,10 @@ ppa : debian-source
# "-lpdcurses -lgdi32 -lcomdlg32"
MINGW_UI=pdcurses

mingw-binary : sciteco-$(SCITECO_VERSION)-win32.zip
sciteco-$(SCITECO_VERSION)-win32.zip : $(SCITECO_SRC)
mingw-binary : @PACKAGE@-@PACKAGE_VERSION@-win32.zip
@PACKAGE@-@PACKAGE_VERSION@-win32.zip : $(SCITECO_SRC)
tar xzf $(SCITECO_SRC)
(cd sciteco-$(SCITECO_VERSION); \
(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 \
Expand All @@ -114,17 +117,17 @@ sciteco-$(SCITECO_VERSION)-win32.zip : $(SCITECO_SRC)
CFLAGS="-g -O3 -flto" CXXFLAGS="-g -O3 -flto" \
LDFLAGS="-flto"; \
)
$(MAKE) -C sciteco-$(SCITECO_VERSION) \
$(MAKE) -C $(SCITECO_DIR) \
install-strip DESTDIR=`pwd`/temp-install
rm -rf sciteco-$(SCITECO_VERSION)/
rm -rf $(SCITECO_DIR)/
mkdir temp-bin/
cp -r temp-install/usr/bin/* temp-install/usr/share/sciteco/* \
temp-install/usr/share/doc/sciteco/* \
temp-bin/
cp $(SRCDIR)/win32.teco_ini temp-bin/.teco_ini || \
cp @srcdir@/win32.teco_ini temp-bin/.teco_ini || \
cp temp-install/usr/share/sciteco/sample.teco_ini \
temp-bin/.teco_ini
cp $(SRCDIR)/COPYING $(SRCDIR)/ChangeLog temp-bin/
cp @srcdir@/COPYING @srcdir@/ChangeLog temp-bin/
rm -rf temp-install/
# cp /usr/i686-w64-mingw32/bin/intl.dll \
# /usr/i686-w64-mingw32/bin/libglib-2.0-0.dll \
Expand All @@ -139,4 +142,4 @@ sciteco-$(SCITECO_VERSION)-win32.zip : $(SCITECO_SRC)
clean:
rm -rf $(SCITECO_SRC)
rm -rf debian-temp/
rm -rf sciteco-$(SCITECO_VERSION)/
rm -rf $(SCITECO_DIR)/

0 comments on commit c9c6e63

Please sign in to comment.