X-Git-Url: https://git.subgeniuskitty.com/xmenu/.git/blobdiff_plain/a77326901f6923610c36bab6abda3ffca4ed8d3e..HEAD:/Makefile diff --git a/Makefile b/Makefile index ac49c3c..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} @@ -10,9 +36,6 @@ ${PROG}: ${OBJS} ${OBJS}: config.h -config.h: config.def.h - cp config.def.h $@ - .c.o: ${CC} ${CFLAGS} -c $< @@ -20,10 +43,13 @@ clean: -rm ${OBJS} ${PROG} install: all - install -d ${DESTDIR}${PREFIX}/bin/ - install -m 755 ${PROG} ${DESTDIR}${PREFIX}/bin/ + 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 ${bindir}/bin/${PROG} + rm -f ${mandir}/man1/${PROG}.1 .PHONY: all clean install uninstall