Introduction
Introduction Statistics Contact Development Disclaimer Help
Makefile, config.mk: use pkg-config, fix config.h rule + tweaks - svkbd - simpl…
git clone git://git.suckless.org/svkbd
Log
Files
Refs
README
LICENSE
---
commit 3fe7bcc7a48ead2aa6246d2e78de64c74d8508f9
parent 13d20da8efda2fc025279cf22b8b66bd0beff6c7
Author: Hiltjo Posthuma <[email protected]>
Date: Sun, 2 Aug 2020 18:23:30 +0200
Makefile, config.mk: use pkg-config, fix config.h rule + tweaks
Diffstat:
M Makefile | 13 +++++++++----
M config.mk | 14 ++++++++++----
2 files changed, 19 insertions(+), 8 deletions(-)
---
diff --git a/Makefile b/Makefile
@@ -9,7 +9,7 @@ include config.mk
BIN = ${NAME}-${LAYOUT}
SRC = drw.c ${NAME}.c util.c
-OBJ = ${NAME}-${LAYOUT}.o
+OBJ = ${SRC:.c=.o}
MAN1 = ${NAME}.1
all: ${BIN}
@@ -24,11 +24,16 @@ options:
config.h:
cp config.def.h $@
-${BIN}:
- ${CC} -o $@ ${SRC} ${SVKBD_CFLAGS} ${SVKBD_CPPFLAGS} ${SVKBD_LDFLAGS}
+.c.o:
+ ${CC} ${SVKBD_CFLAGS} ${SVKBD_CPPFLAGS} -c $<
+
+${OBJ}: config.h config.mk
+
+${BIN}: ${OBJ}
+ ${CC} -o ${BIN} ${OBJ} ${SVKBD_LDFLAGS}
clean:
- rm -f ${NAME}-?? ${NAME}-??.o ${OBJ}
+ rm -f ${NAME}-?? ${NAME}-??.o ${OBJ} ${BIN}
dist:
rm -rf "${NAME}-${VERSION}"
diff --git a/config.mk b/config.mk
@@ -7,15 +7,21 @@ MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
+PKG_CONFIG = pkg-config
+
# Xinerama, comment if you don't want it
XINERAMALIBS = -L${X11LIB} -lXinerama
XINERAMAFLAGS = -DXINERAMA
# includes and libs
-INCS = -I. -I./layouts -I${X11INC} -I/usr/include/freetype2
-LIBS = -L${X11LIB} -lX11 -lXtst -lfontconfig -lXft ${XINERAMALIBS}
+INCS = -I. -I./layouts -I${X11INC} \
+ `$(PKG_CONFIG) --cflags fontconfig` \
+ `$(PKG_CONFIG) --cflags freetype2`
+LIBS = -L${X11LIB} -lX11 -lXtst -lXft ${XINERAMALIBS} \
+ `$(PKG_CONFIG) --libs fontconfig` \
+ `$(PKG_CONFIG) --libs freetype2`
# use system flags
-SVKBD_CFLAGS = ${CFLAGS}
+SVKBD_CFLAGS = ${CFLAGS} ${INCS}
SVKBD_LDFLAGS = ${LDFLAGS} ${LIBS}
-SVKBD_CPPFLAGS = ${CPPFLAGS} ${INCS} -DVERSION=\"VERSION\" ${XINERAMAFLAGS} -D…
+SVKBD_CPPFLAGS = ${CPPFLAGS} -DVERSION=\"VERSION\" ${XINERAMAFLAGS} -DLAYOUT=\…
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.