aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile72
-rw-r--r--config.mk14
2 files changed, 43 insertions, 43 deletions
diff --git a/Makefile b/Makefile
index a7cd04f..daac40b 100644
--- a/Makefile
+++ b/Makefile
@@ -4,71 +4,71 @@
4include config.mk 4include config.mk
5 5
6SRC = drw.c dmenu.c stest.c util.c 6SRC = drw.c dmenu.c stest.c util.c
7OBJ = ${SRC:.c=.o} 7OBJ = $(SRC:.c=.o)
8 8
9all: options dmenu stest 9all: options dmenu stest
10 10
11options: 11options:
12 @echo dmenu build options: 12 @echo dmenu build options:
13 @echo "CFLAGS = ${CFLAGS}" 13 @echo "CFLAGS = $(CFLAGS)"
14 @echo "LDFLAGS = ${LDFLAGS}" 14 @echo "LDFLAGS = $(LDFLAGS)"
15 @echo "CC = ${CC}" 15 @echo "CC = $(CC)"
16 16
17.c.o: 17.c.o:
18 @echo CC $< 18 @echo CC $<
19 @${CC} -c ${CFLAGS} $< 19 @$(CC) -c $(CFLAGS) $<
20 20
21config.h: 21config.h:
22 @echo creating $@ from config.def.h 22 @echo creating $@ from config.def.h
23 @cp config.def.h $@ 23 @cp config.def.h $@
24 24
25${OBJ}: arg.h config.h config.mk drw.h 25$(OBJ): arg.h config.h config.mk drw.h
26 26
27dmenu: dmenu.o drw.o util.o 27dmenu: dmenu.o drw.o util.o
28 @echo CC -o $@ 28 @echo CC -o $@
29 @${CC} -o $@ dmenu.o drw.o util.o ${LDFLAGS} 29 @$(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
30 30
31stest: stest.o 31stest: stest.o
32 @echo CC -o $@ 32 @echo CC -o $@
33 @${CC} -o $@ stest.o ${LDFLAGS} 33 @$(CC) -o $@ stest.o $(LDFLAGS)
34 34
35clean: 35clean:
36 @echo cleaning 36 @echo cleaning
37 @rm -f dmenu stest ${OBJ} dmenu-${VERSION}.tar.gz 37 @rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
38 38
39dist: clean 39dist: clean
40 @echo creating dist tarball 40 @echo creating dist tarball
41 @mkdir -p dmenu-${VERSION} 41 @mkdir -p dmenu-$(VERSION)
42 @cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1 \ 42 @cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1 \
43 drw.h util.h dmenu_path dmenu_run stest.1 ${SRC} \ 43 drw.h util.h dmenu_path dmenu_run stest.1 $(SRC) \
44 dmenu-${VERSION} 44 dmenu-$(VERSION)
45 @tar -cf dmenu-${VERSION}.tar dmenu-${VERSION} 45 @tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
46 @gzip dmenu-${VERSION}.tar 46 @gzip dmenu-$(VERSION).tar
47 @rm -rf dmenu-${VERSION} 47 @rm -rf dmenu-$(VERSION)
48 48
49install: all 49install: all
50 @echo installing executables to ${DESTDIR}${PREFIX}/bin 50 @echo installing executables to $(DESTDIR)$(PREFIX)/bin
51 @mkdir -p ${DESTDIR}${PREFIX}/bin 51 @mkdir -p $(DESTDIR)$(PREFIX)/bin
52 @cp -f dmenu dmenu_path dmenu_run stest ${DESTDIR}${PREFIX}/bin 52 @cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
53 @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu 53 @chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
54 @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_path 54 @chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
55 @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_run 55 @chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
56 @chmod 755 ${DESTDIR}${PREFIX}/bin/stest 56 @chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
57 @echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1 57 @echo installing manual pages to $(DESTDIR)$(MANPREFIX)/man1
58 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 58 @mkdir -p $(DESTDIR)$(MANPREFIX)/man1
59 @sed "s/VERSION/${VERSION}/g" < dmenu.1 > ${DESTDIR}${MANPREFIX}/man1/dmenu.1 59 @sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
60 @sed "s/VERSION/${VERSION}/g" < stest.1 > ${DESTDIR}${MANPREFIX}/man1/stest.1 60 @sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
61 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dmenu.1 61 @chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
62 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/stest.1 62 @chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1
63 63
64uninstall: 64uninstall:
65 @echo removing executables from ${DESTDIR}${PREFIX}/bin 65 @echo removing executables from $(DESTDIR)$(PREFIX)/bin
66 @rm -f ${DESTDIR}${PREFIX}/bin/dmenu 66 @rm -f $(DESTDIR)$(PREFIX)/bin/dmenu
67 @rm -f ${DESTDIR}${PREFIX}/bin/dmenu_path 67 @rm -f $(DESTDIR)$(PREFIX)/bin/dmenu_path
68 @rm -f ${DESTDIR}${PREFIX}/bin/dmenu_run 68 @rm -f $(DESTDIR)$(PREFIX)/bin/dmenu_run
69 @rm -f ${DESTDIR}${PREFIX}/bin/stest 69 @rm -f $(DESTDIR)$(PREFIX)/bin/stest
70 @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 70 @echo removing manual page from $(DESTDIR)$(MANPREFIX)/man1
71 @rm -f ${DESTDIR}${MANPREFIX}/man1/dmenu.1 71 @rm -f $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
72 @rm -f ${DESTDIR}${MANPREFIX}/man1/stest.1 72 @rm -f $(DESTDIR)$(MANPREFIX)/man1/stest.1
73 73
74.PHONY: all options clean dist install uninstall 74.PHONY: all options clean dist install uninstall
diff --git a/config.mk b/config.mk
index 50fe52c..528704c 100644
--- a/config.mk
+++ b/config.mk
@@ -3,7 +3,7 @@ VERSION = 4.8
3 3
4# paths 4# paths
5PREFIX = /usr/local 5PREFIX = /usr/local
6MANPREFIX = ${PREFIX}/share/man 6MANPREFIX = $(PREFIX)/share/man
7 7
8X11INC = /usr/X11R6/include 8X11INC = /usr/X11R6/include
9X11LIB = /usr/X11R6/lib 9X11LIB = /usr/X11R6/lib
@@ -16,16 +16,16 @@ XINERAMAFLAGS = -DXINERAMA
16FREETYPELIBS = -lfontconfig -lXft 16FREETYPELIBS = -lfontconfig -lXft
17FREETYPEINC = /usr/include/freetype2 17FREETYPEINC = /usr/include/freetype2
18# OpenBSD (uncomment) 18# OpenBSD (uncomment)
19#FREETYPEINC = ${X11INC}/freetype2 19#FREETYPEINC = $(X11INC)/freetype2
20 20
21# includes and libs 21# includes and libs
22INCS = -I${X11INC} -I${FREETYPEINC} 22INCS = -I$(X11INC) -I$(FREETYPEINC)
23LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} 23LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS)
24 24
25# flags 25# flags
26CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} 26CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS)
27CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} 27CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS)
28LDFLAGS = -s ${LIBS} 28LDFLAGS = -s $(LIBS)
29 29
30# compiler and linker 30# compiler and linker
31CC = cc 31CC = cc