commit 43035f27ebc0a5e91667f4d92de0faec69a6e508
parent 532b1dab7dfb00d00ff5e753ce61b4b3d26ee6d3
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 19 Nov 2013 17:46:36 -0800
Move dependencies to respective subdirectories
Diffstat:
4 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/Makefile.common b/Makefile.common
@@ -18,5 +18,14 @@ $(dir)/%.o: $(dir)/%.c | .deps/$(dir)
$(dir)/%.lo: $(dir)/%.c | .deps/$(dir)
$(compile) -fPIC $($(@D)_CFLAGS) $($(@D)_PACKAGE_CFLAGS)
+ifdef $(dir)_PACKAGES
+ ifndef $(dir)_PACKAGE_CFLAGS
+ $(dir)_PACKAGE_CFLAGS := $(shell $(PKG_CONFIG) --cflags $($(dir)_PACKAGES))
+ endif
+ ifndef $(dir)_PACKAGE_LIBS
+ $(dir)_PACKAGE_LIBS := $(shell $(PKG_CONFIG) --libs $($(dir)_PACKAGES))
+ endif
+endif
+
CLEAN_FILES += $($(dir)_TARGETS)
diff --git a/config.mk b/config.mk
@@ -15,20 +15,3 @@ WAYLAND_SCANNER = wayland-scanner
ENABLE_STATIC = 1
ENABLE_SHARED = 1
-# Dependencies
-SWC_PACKAGES = \
- wayland-server \
- libudev \
- libevdev \
- xkbcommon \
- libdrm \
- pixman-1 \
- wld
-LAUNCH_PACKAGES = \
- libdrm
-
-libswc_PACKAGE_CFLAGS = $$($(PKG_CONFIG) --cflags $(SWC_PACKAGES))
-libswc_PACKAGE_LIBS = $$($(PKG_CONFIG) --libs $(SWC_PACKAGES))
-launch_PACKAGE_CFLAGS = $$($(PKG_CONFIG) --cflags $(LAUNCH_PACKAGES))
-launch_PACKAGE_LIBS = $$($(PKG_CONFIG) --libs $(LAUNCH_PACKAGES))
-
diff --git a/launch/Makefile.local b/launch/Makefile.local
@@ -4,6 +4,10 @@ dir := launch
$(dir)_TARGETS := $(dir)/swc-launch
+# Dependencies
+$(dir)_PACKAGES = \
+ libdrm
+
$(dir)/swc-launch: $(dir)/launch.o $(dir)/protocol.o
$(link) $(launch_PACKAGE_LIBS)
diff --git a/libswc/Makefile.local b/libswc/Makefile.local
@@ -18,6 +18,16 @@ $(dir)_SHARED_TARGETS := \
$(dir)_TARGETS += libswc-shared
endif
+# Dependencies
+$(dir)_PACKAGES = \
+ libdrm \
+ libevdev \
+ libudev \
+ pixman-1 \
+ wayland-server \
+ wld \
+ xkbcommon
+
SWC_SOURCES = \
libswc/compositor.c \
libswc/util.c \