Makefile (1247B)
1 PREFIX = /usr/local 2 3 CC = gcc 4 CFLAGS = -O3 -Wall -Wextra 5 6 X11CFLAGS = $(shell pkg-config --cflags x11) 7 X11LIBS = $(shell pkg-config --libs x11) 8 9 BLOCKS := $(wildcard blocks/*.c) 10 11 all: dsblocks sigdsblocks/sigdsblocks xgetrootname/xgetrootname 12 13 dsblocks.o: dsblocks.c shared.h config.h block.h 14 ${CC} -o $@ -c -Wno-missing-field-initializers -Wno-unused-parameter ${CFLAGS} ${X11CFLAGS} $< 15 16 util.o: util.c util.h shared.h 17 ${CC} -o $@ -c ${CFLAGS} ${X11CFLAGS} $< 18 19 blocks/%.o: blocks/%.c blocks/%.h util.h shared.h 20 ${CC} -o $@ -c -Wno-unused-parameter ${CFLAGS} $< 21 22 dsblocks: dsblocks.o util.o ${BLOCKS:c=o} 23 ${CC} -o $@ $^ ${X11LIBS} 24 25 sigdsblocks/sigdsblocks: sigdsblocks/sigdsblocks.c 26 ${CC} -o $@ ${CFLAGS} $< 27 28 xgetrootname/xgetrootname: xgetrootname/xgetrootname.c 29 ${CC} -o $@ ${CFLAGS} ${X11CFLAGS} $< ${X11LIBS} 30 31 clean: 32 rm -f blocks/*.o *.o dsblocks sigdsblocks/sigdsblocks xgetrootname/xgetrootname 33 34 BINDIR = ${DESTDIR}${PREFIX}/bin 35 36 install: all 37 mkdir -p ${BINDIR} 38 cp -f dsblocks sigdsblocks/sigdsblocks xgetrootname/xgetrootname ${BINDIR} 39 chmod 755 ${BINDIR}/dsblocks ${BINDIR}/sigdsblocks ${BINDIR}/xgetrootname 40 41 uninstall: 42 rm -f ${BINDIR}/dsblocks ${BINDIR}/sigdsblocks ${BINDIR}/xgetrootname 43 44 .PHONY: all clean install uninstall