diff options
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 116 |
1 files changed, 86 insertions, 30 deletions
| @@ -1,46 +1,95 @@ | |||
| 1 | # dwm - dynamic window manager | 1 | # ========================= |
| 2 | # See LICENSE file for copyright and license details. | 2 | # config |
| 3 | # ========================= | ||
| 3 | 4 | ||
| 4 | include src/config/config.mk | 5 | PREFIX = /usr/local |
| 6 | MANPREFIX = ${PREFIX}/share/man | ||
| 5 | 7 | ||
| 6 | SRC = src/drw/drw.c src/core/dwm.c src/util/util.c | 8 | X11INC = /usr/X11R6/include |
| 7 | OBJ = $(SRC:.c=.o) | 9 | X11LIB = /usr/X11R6/lib |
| 8 | 10 | ||
| 9 | CFLAGS += -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os \ | 11 | FREETYPEINC = /usr/include/freetype2 |
| 10 | -I/usr/X11R6/include \ | 12 | FREETYPELIBS= -lfontconfig -lXft |
| 11 | -I/usr/include/freetype2 \ | 13 | |
| 12 | -I./src/util \ | 14 | XINERAMAFLAGS = -DXINERAMA |
| 15 | XINERAMALIBS = -lXinerama | ||
| 16 | |||
| 17 | # ========================= | ||
| 18 | # flags | ||
| 19 | # ========================= | ||
| 20 | |||
| 21 | INCS = \ | ||
| 22 | -I${X11INC} \ | ||
| 23 | -I${FREETYPEINC} \ | ||
| 24 | -I./src \ | ||
| 13 | -I./src/drw \ | 25 | -I./src/drw \ |
| 14 | -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L \ | 26 | -I./src/util |
| 15 | -DVERSION=\"6.4\" -DXINERAMA | 27 | |
| 28 | CPPFLAGS = \ | ||
| 29 | -D_DEFAULT_SOURCE \ | ||
| 30 | -D_BSD_SOURCE \ | ||
| 31 | -D_XOPEN_SOURCE=700L \ | ||
| 32 | -DVERSION=\"${VERSION}\" \ | ||
| 33 | ${XINERAMAFLAGS} | ||
| 34 | |||
| 35 | CFLAGS = \ | ||
| 36 | -std=c99 \ | ||
| 37 | -pedantic \ | ||
| 38 | -Wall \ | ||
| 39 | -Wno-deprecated-declarations \ | ||
| 40 | -Os \ | ||
| 41 | ${INCS} \ | ||
| 42 | ${CPPFLAGS} | ||
| 43 | |||
| 44 | LDFLAGS = \ | ||
| 45 | -L${X11LIB} \ | ||
| 46 | -lX11 \ | ||
| 47 | ${XINERAMALIBS} \ | ||
| 48 | ${FREETYPELIBS} \ | ||
| 49 | -lX11-xcb \ | ||
| 50 | -lxcb \ | ||
| 51 | -lxcb-res | ||
| 52 | |||
| 53 | CC = clang | ||
| 54 | |||
| 55 | # ========================= | ||
| 56 | # sources | ||
| 57 | # ========================= | ||
| 58 | |||
| 59 | SRC = \ | ||
| 60 | src/core/dwm.c \ | ||
| 61 | src/drw/drw.c \ | ||
| 62 | src/util/util.c | ||
| 63 | # src/core/globals.c \ | ||
| 64 | # src/x11/xevents.c \ | ||
| 65 | # src/x11/xutil.c \ | ||
| 66 | # src/wm/client.c \ | ||
| 67 | # src/wm/monitor.c \ | ||
| 68 | # src/wm/layout.c \ | ||
| 69 | # src/ui/input.c \ | ||
| 70 | # src/ui/bar.c \ | ||
| 71 | # src/ui/systray.c \ | ||
| 16 | 72 | ||
| 17 | LDFLAGS += -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res | 73 | |
| 74 | OBJ = ${SRC:.c=.o} | ||
| 75 | |||
| 76 | # ========================= | ||
| 77 | # build rules | ||
| 78 | # ========================= | ||
| 18 | 79 | ||
| 19 | all: dwm | 80 | all: dwm |
| 20 | 81 | ||
| 21 | %.o: %.c | 82 | %.o: %.c |
| 22 | ${CC} -c ${CFLAGS} -o $@ $< | 83 | ${CC} -c ${CFLAGS} -o $@ $< |
| 23 | 84 | ||
| 24 | ${OBJ}: src/config/config.h src/config/config.mk | ||
| 25 | |||
| 26 | config.h: | ||
| 27 | cp src/config/config.def.h $@ | ||
| 28 | |||
| 29 | dwm: ${OBJ} | 85 | dwm: ${OBJ} |
| 30 | ${CC} -o $@ ${OBJ} ${LDFLAGS} | 86 | ${CC} -o $@ ${OBJ} ${LDFLAGS} |
| 31 | 87 | ||
| 32 | clean: | 88 | # ========================= |
| 33 | rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz | 89 | # install |
| 90 | # ========================= | ||
| 34 | 91 | ||
| 35 | dist: clean | 92 | install: dwm |
| 36 | mkdir -p dwm-${VERSION} | ||
| 37 | cp -R LICENSE Makefile README src/config/config.def.h src/config/config.mk \ | ||
| 38 | src/core/dwm.1 src/drw/drw.h src/util/util.h ${SRC} /assets/dwm.png src/transient/transient.c dwm-${VERSION} | ||
| 39 | tar -cf dwm-${VERSION}.tar dwm-${VERSION} | ||
| 40 | gzip dwm-${VERSION}.tar | ||
| 41 | rm -rf dwm-${VERSION} | ||
| 42 | |||
| 43 | install: all | ||
| 44 | mkdir -p ${DESTDIR}${PREFIX}/bin | 93 | mkdir -p ${DESTDIR}${PREFIX}/bin |
| 45 | cp -f dwm ${DESTDIR}${PREFIX}/bin | 94 | cp -f dwm ${DESTDIR}${PREFIX}/bin |
| 46 | chmod 755 ${DESTDIR}${PREFIX}/bin/dwm | 95 | chmod 755 ${DESTDIR}${PREFIX}/bin/dwm |
| @@ -50,6 +99,13 @@ install: all | |||
| 50 | 99 | ||
| 51 | uninstall: | 100 | uninstall: |
| 52 | rm -f ${DESTDIR}${PREFIX}/bin/dwm \ | 101 | rm -f ${DESTDIR}${PREFIX}/bin/dwm \ |
| 53 | ${DESTDIR}${MANPREFIX}/man1/dwm.1 | 102 | ${DESTDIR}${MANPREFIX}/man1/dwm.1 |
| 103 | |||
| 104 | # ========================= | ||
| 105 | # housekeeping | ||
| 106 | # ========================= | ||
| 107 | |||
| 108 | clean: | ||
| 109 | rm -f dwm ${OBJ} | ||
| 54 | 110 | ||
| 55 | .PHONY: all clean dist install uninstall | 111 | .PHONY: all clean install uninstall |
