X-Git-Url: https://git.subgeniuskitty.com/xmenu/.git/blobdiff_plain/9c891da8b31a7521326cc611bcbe48a510ad0a87..HEAD:/Makefile diff --git a/Makefile b/Makefile index 8044579..ce1a10c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,30 @@ -include config.mk +# program name +PROG = xmenu + +# paths +PREFIX ?= /usr/local +MANPREFIX ?= ${PREFIX}/share/man +LOCALINC ?= /usr/local/include +LOCALLIB ?= /usr/local/lib +X11INC ?= /usr/X11R6/include +X11LIB ?= /usr/X11R6/lib +FREETYPEINC ?= /usr/local/include/freetype2 +# OpenBSD (uncomment) +#FREETYPEINC = ${X11INC}/freetype2 + +# includes and libs +INCS += -I${LOCALINC} -I${X11INC} -I${FREETYPEINC} +LIBS += -L${LOCALLIB} -L${X11LIB} -lfontconfig -lXft -lX11 -lXinerama -lImlib2 + +# flags +CFLAGS += ${DEBUG} -Wall -Wextra ${INCS} ${CPPFLAGS} +LDFLAGS += ${LIBS} + +# compiler and linker +CC = cc + +bindir = ${DESTDIR}${PREFIX} +mandir = ${DESTDIR}${MANPREFIX} SRCS = ${PROG}.c OBJS = ${SRCS:.c=.o} @@ -17,12 +43,13 @@ clean: -rm ${OBJS} ${PROG} install: all - install -d ${DESTDIR}${PREFIX}/bin/ - install -m 755 ${PROG} ${DESTDIR}${PREFIX}/bin/ - install -m 644 ${PROG}.1 ${DESTDIR}${MANPREFIX} + mkdir -p ${bindir}/bin + install -m 755 ${PROG} ${bindir}/bin/${PROG} + mkdir -p ${mandir}/man1 + install -m 644 ${PROG}.1 ${mandir}/man1/${PROG}.1 uninstall: - rm -f ${DESTDIR}/${PREFIX}/bin/${PROG} - rm -f ${DESTDIR}/${MANPREFIX}/man1/${PROG}.1 + rm -f ${bindir}/bin/${PROG} + rm -f ${mandir}/man1/${PROG}.1 .PHONY: all clean install uninstall