applied Sanders Makefile patch

This commit is contained in:
arg@10ksloc.org 2006-08-03 13:50:37 +02:00
parent d41b232b52
commit 4d55eee754
1 changed files with 20 additions and 26 deletions

View File

@ -5,8 +5,6 @@ include config.mk
SRC = client.c draw.c event.c main.c tag.c util.c SRC = client.c draw.c event.c main.c tag.c util.c
OBJ = ${SRC:.c=.o} OBJ = ${SRC:.c=.o}
MAN1 = dwm.1
BIN = dwm
all: options dwm all: options dwm
@echo finished @echo finished
@ -24,7 +22,7 @@ options:
${OBJ}: dwm.h config.h ${OBJ}: dwm.h config.h
config.h: config.h:
@echo missing config.h created @echo creating default $@
@cp config.default.h $@ @cp config.default.h $@
dwm: ${OBJ} dwm: ${OBJ}
@ -32,36 +30,32 @@ dwm: ${OBJ}
@${CC} -o $@ ${OBJ} ${LDFLAGS} @${CC} -o $@ ${OBJ} ${LDFLAGS}
clean: clean:
rm -f dwm *.o dwm-${VERSION}.tar.gz @echo cleaning
@rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
dist: clean dist: clean
mkdir -p dwm-${VERSION} @echo creating dist tarball
cp -R Makefile README LICENSE config.mk dwm.h config.*.h \ @mkdir -p dwm-${VERSION}
${SRC} ${MAN1} dwm-${VERSION} @cp -R LICENSE Makefile README config.*.h config.mk \
tar -cf dwm-${VERSION}.tar dwm-${VERSION} dwm.1 dwm.h ${SRC} dwm-${VERSION}
gzip dwm-${VERSION}.tar @tar -cf dwm-${VERSION}.tar dwm-${VERSION}
rm -rf dwm-${VERSION} @gzip dwm-${VERSION}.tar
@rm -rf dwm-${VERSION}
install: all install: all
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f ${BIN} ${DESTDIR}${PREFIX}/bin @cp -f dwm ${DESTDIR}${PREFIX}/bin
@for i in ${BIN}; do \ @chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
chmod 755 ${DESTDIR}${PREFIX}/bin/`basename $$i`; \ @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
done
@echo installed executable files to ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${MANPREFIX}/man1 @mkdir -p ${DESTDIR}${MANPREFIX}/man1
@cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1 @cp -f dwm.1 ${DESTDIR}${MANPREFIX}/man1
@for i in ${MAN1}; do \ @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
chmod 444 ${DESTDIR}${MANPREFIX}/man1/`basename $$i`; \
done
@echo installed manual pages to ${DESTDIR}${MANPREFIX}/man1
uninstall: uninstall:
for i in ${BIN}; do \ @echo removing executable file from ${DESTDIR}${PREFIX}/bin
rm -f ${DESTDIR}${PREFIX}/bin/`basename $$i`; \ @rm -f ${DESTDIR}${PREFIX}/bin/dwm
done @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
for i in ${MAN1}; do \ @rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1
rm -f ${DESTDIR}${MANPREFIX}/man1/`basename $$i`; \
done
.PHONY: all options clean dist install uninstall .PHONY: all options clean dist install uninstall