diff --git a/.gitignore b/.gitignore index dfa9fc2..9a1cf70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /config/1-generated.mk -/config/2-defvars.mk +/config/2-conditionals.mk /polytreewm /src/*.o diff --git a/Makefile b/Makefile index 3aa9fe1..89a2072 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,13 @@ all: polytreewm include config/1-generated.mk -include config/2-defvars.mk +include config/2-conditionals.mk +include config/3-defvars.mk CONFIGMKS = \ config/1-generated.mk \ - config/2-defvars.mk \ + config/2-conditionals.mk \ + config/3-defvars.mk VERSION = 6.2 diff --git a/config/2-conditionals-bsd.mk b/config/2-conditionals-bsd.mk new file mode 100644 index 0000000..6ff15a5 --- /dev/null +++ b/config/2-conditionals-bsd.mk @@ -0,0 +1,8 @@ +.if "$(ENABLE_GNOME_TERMINAL)" == "yes" +CPPFLAGS += -DENABLE_GNOME_TERMINAL +.endif + +.if "$(ENABLE_XINERAMA)" == "yes" +CPPFLAGS += -DENABLE_XINERAMA +PKGS += xinerama +.endif diff --git a/config/2-conditionals-gnu.mk b/config/2-conditionals-gnu.mk new file mode 100644 index 0000000..49d4050 --- /dev/null +++ b/config/2-conditionals-gnu.mk @@ -0,0 +1,8 @@ +ifeq (yes,$(ENABLE_GNOME_TERMINAL)) +CPPFLAGS += -DENABLE_GNOME_TERMINAL +endif + +ifeq (yes,$(ENABLE_XINERAMA)) +CPPFLAGS += -DENABLE_XINERAMA +PKGS += xinerama +endif diff --git a/config/2-defvars-bsd.mk b/config/2-defvars-bsd.mk deleted file mode 100644 index 0ca7fdf..0000000 --- a/config/2-defvars-bsd.mk +++ /dev/null @@ -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 diff --git a/config/2-defvars-gnu.mk b/config/3-defvars.mk similarity index 68% rename from config/2-defvars-gnu.mk rename to config/3-defvars.mk index 2983d19..50955cc 100644 --- a/config/2-defvars-gnu.mk +++ b/config/3-defvars.mk @@ -3,15 +3,6 @@ PKGCONFIG = pkg-config 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)` LDFLAGS += `$(PKGCONFIG) --libs $(PKGS)` diff --git a/configure b/configure index cf72255..ccf6b17 100755 --- a/configure +++ b/configure @@ -122,7 +122,7 @@ MAKE make_help_result="$(make --help 2>&1 || true)" 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 - ln -sf '2-defvars-gnu.mk' 'config/2-defvars.mk' + ln -sf '2-conditionals-gnu.mk' 'config/2-conditionals.mk' fi