From 7f6d8d457ed15fa997bd720b71c5fc4c5c737e9a Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Fri, 11 Sep 2020 22:20:19 +0200 Subject: [PATCH] slimmed down make and configure --- Makefile | 50 ++++++++++++++++++++++++++++------------ config.def.h => config.h | 0 config.mk | 38 ------------------------------ 3 files changed, 35 insertions(+), 53 deletions(-) rename config.def.h => config.h (100%) delete mode 100644 config.mk diff --git a/Makefile b/Makefile index 77bcbc0..6b7da7c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,40 @@ # dwm - dynamic window manager # See LICENSE file for copyright and license details. -include config.mk +# dwm version +VERSION = 6.2 + +# Customize below to fit your system + +# paths +PREFIX = /usr/local +MANPREFIX = ${PREFIX}/share/man + +X11INC = /usr/X11R6/include +X11LIB = /usr/X11R6/lib + +# Xinerama, comment if you don't want it +XINERAMALIBS = -lXinerama +XINERAMAFLAGS = -DXINERAMA + +# freetype +FREETYPELIBS = -lfontconfig -lXft +FREETYPEINC = /usr/include/freetype2 +# OpenBSD (uncomment) +#FREETYPEINC = ${X11INC}/freetype2 + +# includes and libs +INCS = -I${X11INC} -I${FREETYPEINC} +LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} + +# flags +CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} +#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} +CFLAGS = -std=c99 -pedantic -Wall -Ofast ${INCS} ${CPPFLAGS} +LDFLAGS = ${LIBS} + +# compiler and linker +CC = gcc SRC = drw.c dwm.c util.c OBJ = ${SRC:.c=.o} @@ -17,24 +50,11 @@ options: .c.o: ${CC} -c ${CFLAGS} $< -${OBJ}: config.h config.mk - -config.h: - cp config.def.h $@ - dwm: ${OBJ} ${CC} -o $@ ${OBJ} ${LDFLAGS} clean: - rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz - -dist: clean - mkdir -p dwm-${VERSION} - cp -R LICENSE Makefile README config.def.h config.mk\ - dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} - tar -cf dwm-${VERSION}.tar dwm-${VERSION} - gzip dwm-${VERSION}.tar - rm -rf dwm-${VERSION} + rm -f dwm ${OBJ} install: all mkdir -p ${DESTDIR}${PREFIX}/bin diff --git a/config.def.h b/config.h similarity index 100% rename from config.def.h rename to config.h diff --git a/config.mk b/config.mk deleted file mode 100644 index 6d36cb7..0000000 --- a/config.mk +++ /dev/null @@ -1,38 +0,0 @@ -# dwm version -VERSION = 6.2 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = ${X11INC}/freetype2 - -# includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} - -# flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} -LDFLAGS = ${LIBS} - -# Solaris -#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" -#LDFLAGS = ${LIBS} - -# compiler and linker -CC = cc