build-sys: add basic support for ./configure && make && make install

This adds the basic make support required by
https://github.com/cgwalters/build-api. CFLAGS, CXXFLAGS, DESTDIR variables are
supported:
   ./configure CFLAGS=... CXXFLAGS=... && make && make install DESTDIR=
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-07-13 20:57:43 -04:00
parent 02263eb75e
commit e7e157032b
2 changed files with 26 additions and 0 deletions

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
all:
ninja -C build
install:
DESTDIR=$(DESTDIR) ninja -C build

21
configure vendored Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash -e
cflags=CFLAGS="$CFLAGS"
cxxflags=CXXFLAGS="$CXXFLAGS"
declare -a args
j=0
for i in "$@"; do
case "$i" in
CFLAGS=*)
cflags="$i";;
CXXFLAGS=*)
cxxflags="$i";;
*)
args[$j]="$i"
j=$((j+1))
esac
done
export "$cflags" "$cxxflags"
set -x
exec meson build "${args[@]}"