mirror of https://github.com/djcb/mu.git
We still support autotools for now, but it is no longer the default.pull/2118/head
parent
286d6f70c8
commit
975604d3ee
@ -0,0 +1,43 @@ |
||||
## Copyright (C) 2008-2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software Foundation,
|
||||
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
|
||||
# Makefile with some useful targets for meson/ninja
|
||||
|
||||
NINJA ?= ninja
|
||||
BUILDDIR ?= $(CURDIR)/build
|
||||
MESON ?= meson
|
||||
|
||||
all: $(BUILDDIR) |
||||
$(NINJA) -C $(BUILDDIR)
|
||||
|
||||
$(BUILDDIR): |
||||
$(MESON) $(BUILDDIR)
|
||||
|
||||
check: test |
||||
|
||||
test: $(BUILDDIR) |
||||
@cd $(BUILDDIR); $(MESON) test
|
||||
|
||||
dist: $(BUILDDIR) |
||||
@cd $(BUILDDIR); $(MESON) dist
|
||||
|
||||
install: $(BUILDDIR) |
||||
@cd $(BUILDDIR); $(MESON) install
|
||||
|
||||
clean: |
||||
@test -d $(BUILDDIR) && $(NINJA) -C $(BUILDDIR) clean
|
||||
|
@ -1,34 +1,29 @@ |
||||
#!/bin/sh |
||||
# Run this to generate all the initial makefiles, etc. |
||||
|
||||
echo "*** meson build setup" |
||||
|
||||
test -f mu/mu.cc || { |
||||
echo "*** Run this script from the top-level mu source directory" |
||||
exit 1 |
||||
} |
||||
|
||||
# opportunistically; usually not needed, but occasionally it'll |
||||
# avoid build errors that would otherwise confuse users. |
||||
test -f Makefile && { |
||||
echo "*** clear out old things" |
||||
make distclean 2> /dev/null |
||||
} |
||||
|
||||
BUILDDIR=build |
||||
|
||||
command -V autoreconf > /dev/null |
||||
command -v meson 2> /dev/null |
||||
if [ $? != 0 ]; then |
||||
echo "*** No autoreconf found, please install it ***" |
||||
echo "*** No meson found, please install it ***" |
||||
exit 1 |
||||
fi |
||||
|
||||
rm -f config.cache |
||||
rm -rf autom4te.cache |
||||
|
||||
autoreconf --force --install --verbose || exit $? |
||||
|
||||
if test -z "$*"; then |
||||
echo "# Configuring without parameters" |
||||
# we could remove build/ but let's avoid rm -rf risks... |
||||
if test -d ${BUILDDIR}; then |
||||
meson --reconfigure ${BUILDDIR} |
||||
else |
||||
echo "# Configure with parameters $*" |
||||
meson ${BUILDDIR} $@ |
||||
fi |
||||
|
||||
./configure --config-cache $@ |
||||
# Add a Makefile with some useful target |
||||
cp Makefile.meson Makefile |
||||
|
||||
echo "*** Now run 'ninja -C ${BUILDDIR}' to build mu" |
||||
|
Loading…
Reference in new issue