improve makefile

This commit is contained in:
speedie 2023-03-28 22:16:30 +02:00
parent 528cf95367
commit f773ca8a38
4 changed files with 15 additions and 4 deletions

View file

@ -42,12 +42,14 @@ clean:
dist: clean
mkdir -p spmenu-$(VERSION)
cp -rf LICENSE Makefile *.h *.mk *.c scripts/ docs/ libs/ PKGBUILD build.sh spmenu-$(VERSION)
[ -f buildconf ] && cp buildconf spmenu-$(VERSION) || :
[ -f spmenu.1 ] && cp spmenu.1 spmenu-$(VERSION) || :
tar -cf spmenu-$(VERSION).tar spmenu-$(VERSION)
gzip spmenu-$(VERSION).tar
rm -rf spmenu-$(VERSION)
install: all
install:
[ ! -x spmenu ] && make all || :
rm -rf $(DESTDIR)$(PREFIX)/share/spmenu/
mkdir -p $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(PREFIX)/share/spmenu

View file

@ -95,7 +95,6 @@ build() {
make clean
[ "$GEN_MANUAL" != "false" ] && make man
[ "$INSTALL" != "true" ] && \
make \
CC="$CC" \
PREFIX="$PREFIX" \
@ -142,4 +141,4 @@ check_dist
check
loadconf
build
[ "$INSTALL" != "false" ] && install
[ "$install" != "false" ] && install

10
buildconf Executable file
View file

@ -0,0 +1,10 @@
# buildconf
#
# This is the default configuration used to build spmenu. The build.sh script reads it.
imlib2=true
pango=true
pangoxft=true
xinerama=true
openssl=true
fribidi=true
CC=tcc

View file

@ -90,7 +90,7 @@ readstdin(void)
// spmenu:about
if (!strncmp("about", items[i].ex, strlen("about"))) {
int i = system("printf \"spmenu $([ -f '/usr/share/spmenu/version' ] && cat /usr/share/spmenu/version || printf unknown)\\nBased on dmenu 5.2 from https://tools.suckless.org/dmenu\\nCompiled $([ -f '/usr/share/spmenu/compile-date' ] && cat /usr/share/spmenu/compile-date || printf unknown)\\nCFLAGS: $([ -f '/usr/share/spmenu/cflags' ] && cat /usr/share/spmenu/cflags || printf unknown)\\nCC: $([ -f '/usr/share/spmenu/cc' ] && cat /usr/share/spmenu/cc || printf unknown)\" | spmenu --columns 1 --lines 5 --hide-cursor --no-allow-typing --hide-mode --hide-match-count --hide-prompt --hide-powerline --hide-input --no-indent --no-color-items > /dev/null");
int i = system("printf \"spmenu $([ -f '/usr/share/spmenu/version' ] && cat /usr/share/spmenu/version || printf unknown)\\nBased on dmenu 5.2 from https://tools.suckless.org/dmenu\\nCompiled $([ -f '/usr/share/spmenu/compile-date' ] && cat /usr/share/spmenu/compile-date || printf Unknown)\\nCFLAGS: $([ -f '/usr/share/spmenu/cflags' ] && cat /usr/share/spmenu/cflags || printf unknown)\\nCC: $([ -f '/usr/share/spmenu/cc' ] && cat /usr/share/spmenu/cc || printf unknown)\\nDistro: $([ -f '/usr/share/spmenu/pkg_arch' ] && echo Arch || echo Installed manually)\\n\" | spmenu --columns 1 --lines 10 --hide-cursor --no-allow-typing --hide-mode --hide-match-count --hide-prompt --hide-powerline --hide-input --no-indent --no-color-items > /dev/null");
if (i||!i) exit(0);
}