Skip to content

Commit

Permalink
Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
phillbush committed Mar 21, 2022
1 parent 6393f03 commit 147b34b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CHANGELOG

3.0.1 (2022-03-21).
• Fix Makefile.

3.0.0 (2022-03-19).
• Removed options -r, -m, -p and -P (check manual for new options).
• Fix missing header (#14).
Expand Down
23 changes: 7 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# program name
PROG = pmenu

# paths
PREFIX ?= /usr/local
MANPREFIX ?= ${PREFIX}/share/man
Expand All @@ -16,35 +13,29 @@ FREETYPEINC ?= /usr/include/freetype2
INCS += -I${LOCALINC} -I${X11INC} -I${FREETYPEINC}
LIBS += -L${LOCALLIB} -L${X11LIB} -lm -lfontconfig -lXft -lX11 -lXinerama -lXrender -lXext -lImlib2

# flags
#DEBUG += -g -O0
CFLAGS += ${DEBUG} -Wall -Wextra ${INCS} ${CPPFLAGS}
LDFLAGS += ${LIBS}

# compiler and linker
CC ?= cc

# files
PROG = pmenu
SRCS = ${PROG}.c
OBJS = ${SRCS:.c=.o}

all: ${PROG}

${PROG}: ${OBJS}
${CC} -o $@ ${OBJS} ${LDFLAGS}
${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}

${OBJS}: config.h

.c.o:
${CC} ${CFLAGS} -c $<
${CC} ${CFLAGS} ${CPPFLAGS} ${INCS} -c $<

clean:
-rm ${OBJS} ${PROG}
-rm -f ${OBJS} ${PROG} ${PROG:=.core}

install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
install -m 755 ${PROG} ${DESTDIR}${PREFIX}/bin/${PROG}
mkdir -p ${DESTDIR}${MANPREFIX}/man1
install -m 644 ${PROG}.1 ${DESTDIR}${MANPREFIX}/man1/${PROG}.1
${INSTALL} -m 755 ${PROG} ${DESTDIR}${PREFIX}/bin/${PROG}
${INSTALL} -m 644 ${PROG}.1 ${DESTDIR}${MANPREFIX}/man1/${PROG}.1

uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/${PROG}
Expand Down

0 comments on commit 147b34b

Please sign in to comment.