--- Makefile.orig 2022-01-22 09:18:24 UTC +++ Makefile @@ -2,13 +2,15 @@ DESTDIR?=/usr VERSION?=0.3.4 DESTDIR?=/usr +PREFIX=%%PREFIX%% +LOCALBASE=%%LOCALBASE%% # set to YES if you want to use Core Audio # note that you must use Core Audio for OSX USE_CA=NO # set to YES if you want to use PulseAudio instead of OSS -USE_PA=YES +USE_PA=NO # set to YES if you compile with MINGW32 USE_WIN32=NO @@ -27,8 +29,8 @@ ifeq ($(USE_WIN32), YES) ifeq ($(USE_WIN32), YES) CC=i686-w64-mingw32-gcc-posix -else - CC=gcc +#else +# CC=gcc endif INSTALL ?= install @@ -38,7 +40,7 @@ BUILD_INFO=" Date: $(shell date +%Y-%m-%dT%H:%M:%S%z)\ BUILD_INFO=" Date: $(shell date +%Y-%m-%dT%H:%M:%S%z)\n git branch/commit: $(shell if [ x${CI_COMMIT_REF_NAME} != x ]; then echo ${CI_COMMIT_REF_NAME} ; elif [ -e .git ] || [ -e ../.git ]; then git symbolic-ref --short HEAD ; else echo not built from git repository ; fi) / $(shell if [ x${CI_COMMIT_SHA} != x ]; then echo ${CI_COMMIT_SHA}; elif [ -e .git ] || [ -e ../.git ] ; then git rev-parse --verify HEAD ; else echo - ; fi )\n by $(USER)@$(shell hostname -f)\n OS: $(shell uname -s -r -p)\n Compiler: $(shell $(CC) --version | head -1)" -CFLAGS:=$(CFLAGS) -D DESTDIR=\"$(DESTDIR)\" -D BUILD_INFO=\"$(BUILD_INFO)\" -D VERSION=\"$(VERSION)\" -I. +CFLAGS:=$(CFLAGS) -I${LOCALBASE}/include -D DESTDIR=\"$(DESTDIR)\" -D BUILD_INFO=\"$(BUILD_INFO)\" -D VERSION=\"$(VERSION)\" -I. ifeq ($(USE_CA), YES) CC=clang @@ -68,14 +70,14 @@ else OBJECTS=qrq.o qrq.res lib/libncursesw.a else OBJECTS=qrq.o oss.o - LDFLAGS:=$(LDFLAGS) -lpthread -lncurses + LDFLAGS:= $(LDFLAGS) -lpthread -lncurses CFLAGS:=$(CFLAGS) -D OSS endif all: qrq qrq: $(OBJECTS) - $(CC) -Wall -o $@ $^ -lm $(LDFLAGS) + $(CC) -Wall -o $@ $^ -lm -L${LOCALBASE}/lib $(LDFLAGS) .c.o: $(CC) -Wall $(CPPFLAGS) $(CFLAGS) -c $< @@ -109,28 +111,27 @@ install: qrq else install: qrq - ${INSTALL} -d -v $(DESTDIR)/share/qrq/ - ${INSTALL} -d -v $(DESTDIR)/share/man/man1/ - ${INSTALL} -d -v $(DESTDIR)/bin/ - ${INSTALL} -s -m 0755 qrq $(DESTDIR)/bin/ - ${INSTALL} -m 0755 qrqscore $(DESTDIR)/bin/ - ${INSTALL} -m 0644 qrq.1 $(DESTDIR)/share/man/man1/ - ${INSTALL} -m 0644 callbase.qcb $(DESTDIR)/share/qrq/ - ${INSTALL} -m 0644 english.qcb $(DESTDIR)/share/qrq/ - ${INSTALL} -m 0644 cwops.qcb $(DESTDIR)/share/qrq/ - ${INSTALL} -m 0644 qrqrc $(DESTDIR)/share/qrq/ - ${INSTALL} -m 0644 toplist $(DESTDIR)/share/qrq/ + ${INSTALL} -d -v $(DESTDIR)${PREFIX}/share/qrq/ + ${INSTALL} -d -v $(DESTDIR)${PREFIX}/bin/ + ${INSTALL} -s -m 0755 qrq $(DESTDIR)${PREFIX}/bin/ + ${INSTALL} -m 0755 qrqscore $(DESTDIR)${PREFIX}/bin/ + ${INSTALL} -m 0644 qrq.1 $(DESTDIR)${PREFIX}/share/man/man1/ + ${INSTALL} -m 0644 callbase.qcb $(DESTDIR)${PREFIX}/share/qrq/ + ${INSTALL} -m 0644 english.qcb $(DESTDIR)${PREFIX}/share/qrq/ + ${INSTALL} -m 0644 cwops.qcb $(DESTDIR)${PREFIX}/share/qrq/ + ${INSTALL} -m 0644 qrqrc $(DESTDIR)${PREFIX}/share/qrq/ + ${INSTALL} -m 0644 toplist $(DESTDIR)${PREFIX}/share/qrq/ uninstall: - rm -f $(DESTDIR)/bin/qrq - rm -f $(DESTDIR)/bin/qrqscore - rm -f $(DESTDIR)/share/man/man1/qrq.1 - rm -f $(DESTDIR)/share/qrq/callbase.qcb - rm -f $(DESTDIR)/share/qrq/english.qcb - rm -f $(DESTDIR)/share/qrq/qrqrc - rm -f $(DESTDIR)/share/qrq/toplist - rmdir $(DESTDIR)/share/qrq/ + rm -f $(DESTDIR)${PREFIX}/bin/qrq + rm -f $(DESTDIR)${PREFIX}/bin/qrqscore + rm -f $(DESTDIR)${PREFIX}/share/man/man1/qrq.1 + rm -f $(DESTDIR)${PREFIX}/share/qrq/callbase.qcb + rm -f $(DESTDIR)${PREFIX}/share/qrq/english.qcb + rm -f $(DESTDIR)${PREFIX}/share/qrq/qrqrc + rm -f $(DESTDIR)${PREFIX}/share/qrq/toplist + rmdir $(DESTDIR)${PREFIX}/share/qrq/ endif