1
0
Fork 0

Makefile: respect PREFIX

Allows easily appending a prefix to all variables. Again, a standard
used frequently by packagers. Not just for things like Gentoo Prefix
but also e.g. macports where everything ends up installed in some path
beginning with /usr/local, or /opt, or ...

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James 2022-03-31 04:13:38 +01:00
parent 8f4beee8f9
commit 0130773b31
1 changed files with 6 additions and 6 deletions

View File

@ -3,10 +3,10 @@
#-O3 --std=c99 -lcurses -DNO_MOUSE for NetBSD curses
#adding --std=c99 makes warnings in GNU, and the blame is upon glibc feature test macros. my code is correct.
GAMES_DIR?=/usr/games
SCORES_DIR?=/var/games
MAN_DIR?=/usr/share/man/man6
CFLAGS+= -Wno-unused-result -D SCORES_DIR=\"$(SCORES_DIR)\"
GAMES_DIR?=$(PREFIX)/usr/games
SCORES_DIR?=$(PREFIX)/var/games
MAN_DIR?=$(PREFIX)/usr/share/man/man6
CFLAGS+= -Wno-unused-result -D SCORES_DIR=\"$(PREFIX)$(SCORES_DIR)\"
PKG-CONFIG?=pkg-config
LIBS=$(shell pkg-config --libs --cflags ncurses) -lm
@ -61,8 +61,8 @@ snakeduel: snakeduel.c config.h
tugow: tugow.c common.h
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -o $@
menu:
cp nbsdgames.desktop $(DESTIDR)/usr/share/applications
cp nbsdgames.svg $(DESTDIR)/usr/share/pixmaps
cp nbsdgames.desktop $(DESTIDR)$(PREFIX)/usr/share/applications
cp nbsdgames.svg $(DESTDIR)$(PREFIX)/usr/share/pixmaps
clean:
for game in $(ALL); do rm $$game; done;
uninstall: