22 @${CC} -c ${CFLAGS} $< |
20 @${CC} -c ${CFLAGS} $< |
23 |
21 |
24 ${OBJ}: dwm.h config.h |
22 ${OBJ}: dwm.h config.h |
25 |
23 |
26 config.h: |
24 config.h: |
27 @echo missing config.h created |
25 @echo creating default $@ |
28 @cp config.default.h $@ |
26 @cp config.default.h $@ |
29 |
27 |
30 dwm: ${OBJ} |
28 dwm: ${OBJ} |
31 @echo LD $@ |
29 @echo LD $@ |
32 @${CC} -o $@ ${OBJ} ${LDFLAGS} |
30 @${CC} -o $@ ${OBJ} ${LDFLAGS} |
33 |
31 |
34 clean: |
32 clean: |
35 rm -f dwm *.o dwm-${VERSION}.tar.gz |
33 @echo cleaning |
|
34 @rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz |
36 |
35 |
37 dist: clean |
36 dist: clean |
38 mkdir -p dwm-${VERSION} |
37 @echo creating dist tarball |
39 cp -R Makefile README LICENSE config.mk dwm.h config.*.h \ |
38 @mkdir -p dwm-${VERSION} |
40 ${SRC} ${MAN1} dwm-${VERSION} |
39 @cp -R LICENSE Makefile README config.*.h config.mk \ |
41 tar -cf dwm-${VERSION}.tar dwm-${VERSION} |
40 dwm.1 dwm.h ${SRC} dwm-${VERSION} |
42 gzip dwm-${VERSION}.tar |
41 @tar -cf dwm-${VERSION}.tar dwm-${VERSION} |
43 rm -rf dwm-${VERSION} |
42 @gzip dwm-${VERSION}.tar |
|
43 @rm -rf dwm-${VERSION} |
44 |
44 |
45 install: all |
45 install: all |
|
46 @echo installing executable file to ${DESTDIR}${PREFIX}/bin |
46 @mkdir -p ${DESTDIR}${PREFIX}/bin |
47 @mkdir -p ${DESTDIR}${PREFIX}/bin |
47 @cp -f ${BIN} ${DESTDIR}${PREFIX}/bin |
48 @cp -f dwm ${DESTDIR}${PREFIX}/bin |
48 @for i in ${BIN}; do \ |
49 @chmod 755 ${DESTDIR}${PREFIX}/bin/dwm |
49 chmod 755 ${DESTDIR}${PREFIX}/bin/`basename $$i`; \ |
50 @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 |
50 done |
|
51 @echo installed executable files to ${DESTDIR}${PREFIX}/bin |
|
52 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 |
51 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 |
53 @cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1 |
52 @cp -f dwm.1 ${DESTDIR}${MANPREFIX}/man1 |
54 @for i in ${MAN1}; do \ |
53 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 |
55 chmod 444 ${DESTDIR}${MANPREFIX}/man1/`basename $$i`; \ |
|
56 done |
|
57 @echo installed manual pages to ${DESTDIR}${MANPREFIX}/man1 |
|
58 |
54 |
59 uninstall: |
55 uninstall: |
60 for i in ${BIN}; do \ |
56 @echo removing executable file from ${DESTDIR}${PREFIX}/bin |
61 rm -f ${DESTDIR}${PREFIX}/bin/`basename $$i`; \ |
57 @rm -f ${DESTDIR}${PREFIX}/bin/dwm |
62 done |
58 @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 |
63 for i in ${MAN1}; do \ |
59 @rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1 |
64 rm -f ${DESTDIR}${MANPREFIX}/man1/`basename $$i`; \ |
|
65 done |
|
66 |
60 |
67 .PHONY: all options clean dist install uninstall |
61 .PHONY: all options clean dist install uninstall |