diff Makefile @ 0:7024076fa948

initial add
author paulo@localhost
date Sun, 22 Mar 2009 23:26:35 -0700
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Sun Mar 22 23:26:35 2009 -0700
     1.3 @@ -0,0 +1,61 @@
     1.4 +# dwm - dynamic window manager
     1.5 +#   (C)opyright MMVI-MMVII Anselm R. Garbe
     1.6 +
     1.7 +include config.mk
     1.8 +
     1.9 +SRC = client.c draw.c event.c layout.c main.c tag.c util.c
    1.10 +OBJ = ${SRC:.c=.o}
    1.11 +
    1.12 +all: options dwm
    1.13 +
    1.14 +options:
    1.15 +	@echo dwm build options:
    1.16 +	@echo "CFLAGS   = ${CFLAGS}"
    1.17 +	@echo "LDFLAGS  = ${LDFLAGS}"
    1.18 +	@echo "CC       = ${CC}"
    1.19 +
    1.20 +.c.o:
    1.21 +	@echo CC $<
    1.22 +	@${CC} -c ${CFLAGS} $<
    1.23 +
    1.24 +${OBJ}: dwm.h config.h config.mk
    1.25 +
    1.26 +config.h:
    1.27 +	@echo creating $@ from config.default.h
    1.28 +	@cp config.default.h $@
    1.29 +
    1.30 +dwm: ${OBJ}
    1.31 +	@echo CC -o $@
    1.32 +	@${CC} -o $@ ${OBJ} ${LDFLAGS}
    1.33 +	@strip $@
    1.34 +
    1.35 +clean:
    1.36 +	@echo cleaning
    1.37 +	@rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
    1.38 +
    1.39 +dist: clean
    1.40 +	@echo creating dist tarball
    1.41 +	@mkdir -p dwm-${VERSION}
    1.42 +	@cp -R LICENSE Makefile README config.*.h config.mk \
    1.43 +		dwm.1 dwm.h ${SRC} dwm-${VERSION}
    1.44 +	@tar -cf dwm-${VERSION}.tar dwm-${VERSION}
    1.45 +	@gzip dwm-${VERSION}.tar
    1.46 +	@rm -rf dwm-${VERSION}
    1.47 +
    1.48 +install: all
    1.49 +	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
    1.50 +	@mkdir -p ${DESTDIR}${PREFIX}/bin
    1.51 +	@cp -f dwm ${DESTDIR}${PREFIX}/bin
    1.52 +	@chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
    1.53 +	@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
    1.54 +	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
    1.55 +	@sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
    1.56 +	@chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
    1.57 +
    1.58 +uninstall:
    1.59 +	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
    1.60 +	@rm -f ${DESTDIR}${PREFIX}/bin/dwm
    1.61 +	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
    1.62 +	@rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1
    1.63 +
    1.64 +.PHONY: all options clean dist install uninstall