Better organize makefiles
This commit is contained in:
parent
4bca8fc8f5
commit
5559bc4375
7 changed files with 23 additions and 33 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
/config/1-generated.mk
|
/config/1-generated.mk
|
||||||
/config/2-defvars.mk
|
/config/2-conditionals.mk
|
||||||
/polytreewm
|
/polytreewm
|
||||||
/src/*.o
|
/src/*.o
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -4,11 +4,13 @@
|
||||||
all: polytreewm
|
all: polytreewm
|
||||||
|
|
||||||
include config/1-generated.mk
|
include config/1-generated.mk
|
||||||
include config/2-defvars.mk
|
include config/2-conditionals.mk
|
||||||
|
include config/3-defvars.mk
|
||||||
|
|
||||||
CONFIGMKS = \
|
CONFIGMKS = \
|
||||||
config/1-generated.mk \
|
config/1-generated.mk \
|
||||||
config/2-defvars.mk \
|
config/2-conditionals.mk \
|
||||||
|
config/3-defvars.mk
|
||||||
|
|
||||||
VERSION = 6.2
|
VERSION = 6.2
|
||||||
|
|
||||||
|
|
8
config/2-conditionals-bsd.mk
Normal file
8
config/2-conditionals-bsd.mk
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
.if "$(ENABLE_GNOME_TERMINAL)" == "yes"
|
||||||
|
CPPFLAGS += -DENABLE_GNOME_TERMINAL
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.if "$(ENABLE_XINERAMA)" == "yes"
|
||||||
|
CPPFLAGS += -DENABLE_XINERAMA
|
||||||
|
PKGS += xinerama
|
||||||
|
.endif
|
8
config/2-conditionals-gnu.mk
Normal file
8
config/2-conditionals-gnu.mk
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
ifeq (yes,$(ENABLE_GNOME_TERMINAL))
|
||||||
|
CPPFLAGS += -DENABLE_GNOME_TERMINAL
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq (yes,$(ENABLE_XINERAMA))
|
||||||
|
CPPFLAGS += -DENABLE_XINERAMA
|
||||||
|
PKGS += xinerama
|
||||||
|
endif
|
|
@ -1,19 +0,0 @@
|
||||||
CC = cc
|
|
||||||
PKGCONFIG = pkg-config
|
|
||||||
|
|
||||||
PKGS += fontconfig freetype2 x11 x11-xcb xcb xcb-res xft
|
|
||||||
|
|
||||||
.if "$(ENABLE_GNOME_TERMINAL)" == "yes"
|
|
||||||
CPPFLAGS += -DENABLE_GNOME_TERMINAL
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if "$(ENABLE_XINERAMA)" == "yes"
|
|
||||||
CPPFLAGS += -DENABLE_XINERAMA
|
|
||||||
PKGS += xinerama
|
|
||||||
.endif
|
|
||||||
|
|
||||||
CFLAGS += `$(PKGCONFIG) --cflags $(PKGS)`
|
|
||||||
LDFLAGS += `$(PKGCONFIG) --libs $(PKGS)`
|
|
||||||
|
|
||||||
CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L
|
|
||||||
CFLAGS += $(CPPFLAGS) -std=c99 -Os -pedantic -Wall -Wno-deprecated-declarations
|
|
|
@ -3,15 +3,6 @@ PKGCONFIG = pkg-config
|
||||||
|
|
||||||
PKGS += fontconfig freetype2 x11 x11-xcb xcb xcb-res xft
|
PKGS += fontconfig freetype2 x11 x11-xcb xcb xcb-res xft
|
||||||
|
|
||||||
ifeq (yes,$(ENABLE_GNOME_TERMINAL))
|
|
||||||
CPPFLAGS += -DENABLE_GNOME_TERMINAL
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (yes,$(ENABLE_XINERAMA))
|
|
||||||
CPPFLAGS += -DENABLE_XINERAMA
|
|
||||||
PKGS += xinerama
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFLAGS += `$(PKGCONFIG) --cflags $(PKGS)`
|
CFLAGS += `$(PKGCONFIG) --cflags $(PKGS)`
|
||||||
LDFLAGS += `$(PKGCONFIG) --libs $(PKGS)`
|
LDFLAGS += `$(PKGCONFIG) --libs $(PKGS)`
|
||||||
|
|
4
configure
vendored
4
configure
vendored
|
@ -122,7 +122,7 @@ MAKE
|
||||||
|
|
||||||
make_help_result="$(make --help 2>&1 || true)"
|
make_help_result="$(make --help 2>&1 || true)"
|
||||||
if [ "$(echo "$make_help_result" | grep 'gnu.org')" = '' ]; then
|
if [ "$(echo "$make_help_result" | grep 'gnu.org')" = '' ]; then
|
||||||
ln -sf '2-defvars-bsd.mk' 'config/2-defvars.mk'
|
ln -sf '2-conditionals-bsd.mk' 'config/2-conditionals.mk'
|
||||||
else
|
else
|
||||||
ln -sf '2-defvars-gnu.mk' 'config/2-defvars.mk'
|
ln -sf '2-conditionals-gnu.mk' 'config/2-conditionals.mk'
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue