Configure build

This commit is contained in:
Alex Kotov 2021-11-17 00:48:06 +05:00
parent 95654caff0
commit 0606973e5e
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
7 changed files with 55 additions and 46 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/config/active.mk
/polytreewm
/src/*.o

View file

@ -1,7 +1,16 @@
# PolytreeWM - tiling window manager
# See LICENSE file for copyright and license details.
include config.mk
include config/active.mk
VERSION = 6.2
INCS = -I$(X11INC) -I$(FREETYPEINC)
LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) -lX11-xcb -lxcb -lxcb-res $(KVMLIB)
CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DXINERAMA
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os $(INCS) $(CPPFLAGS)
LDFLAGS = $(LIBS)
SRC = \
src/atoms.c \
@ -56,6 +65,9 @@ ${OBJ}: config.mk ${HDR}
clean:
rm -f polytreewm ${OBJ}
distclean: clean
rm -f config/active.mk
install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f polytreewm ${DESTDIR}${PREFIX}/bin
@ -70,4 +82,4 @@ uninstall:
${DESTDIR}${PREFIX}/bin/polytreewm \
${DESTDIR}${MANPREFIX}/man1/polytreewm.1
.PHONY: all options clean install uninstall
.PHONY: all options clean distclean install uninstall

View file

@ -1,44 +0,0 @@
# PolytreeWM 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
# FreeBSD (uncomment)
#X11INC = /usr/local/include
#X11LIB = /usr/local/lib
# Xinerama, comment if you don't want it
XINERAMALIBS = -lXinerama
XINERAMAFLAGS = -DXINERAMA
# freetype
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2
# FreeBSD (uncomment)
#FREETYPEINC = /usr/local/include/freetype2
# OpenBSD (uncomment)
#FREETYPEINC = ${X11INC}/freetype2
#KVMLIB = -lkvm
# includes and libs
INCS = -I${X11INC} -I${FREETYPEINC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lX11-xcb -lxcb -lxcb-res ${KVMLIB}
# flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -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

24
config/default.mk Normal file
View file

@ -0,0 +1,24 @@
##########################
# Compiler, linker, etc. #
##########################
CC = cc
#########
# Paths #
#########
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
################
# Dependencies #
################
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
XINERAMALIBS = -lXinerama
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2

6
config/freebsd.mk Normal file
View file

@ -0,0 +1,6 @@
include default.mk
X11INC = /usr/local/include
X11LIB = /usr/local/lib
FREETYPEINC = /usr/include/freetype2

5
config/openbsd.mk Normal file
View file

@ -0,0 +1,5 @@
include default.mk
FREETYPEINC = $(X11INC)/freetype2
KVMLIB = -lkvm

5
configure vendored Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
set -e
ln -sf default.mk config/active.mk