Bump to release 1.4.0
[smenu.git] / build.sh
blobc3c1dabbb3bbcea474215769775fc5b96d5a2cbc
1 #!/bin/sh
3 # ###################################################################
4 # Copyright 2015, Pierre Gentile (p.gen.progs@gmail.com)
6 # This Source Code Form is subject to the terms of the Mozilla Public
7 # License, v. 2.0. If a copy of the MPL was not distributed with this
8 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
9 # ###################################################################
11 # Manage --help option
12 # """"""""""""""""""""
13 if echo "$@" | grep -- "--help"; then
14 ./configure --help | sed s/configure/build.sh/g
15 exit 1
18 # Ensure that aclocal wont' be called
19 # """""""""""""""""""""""""""""""""""
20 touch aclocal.m4
21 touch Makefile.in configure config.h.in
23 # Create the Makefile
24 # """""""""""""""""""
25 ./configure "$@"
27 # Add the git version if this is a git clone
28 # """"""""""""""""""""""""""""""""""""""""""
29 [ -d .git ] && V=`git log -1 --pretty=format:-%h` || V=""
31 sed "/VERSION/s/\$/ \"$V\"/" config.h > /tmp/config.h$$
32 mv /tmp/config.h$$ config.h
34 # Create the executable
35 # """""""""""""""""""""
36 make
38 exit 0