swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit cdf296e23fe0e7a8efa1a0b394fed995ec6b0d55
parent 58ce44667c5a30e956151ed0dcfebdce4354712d
Author: Michael Forney <mforney@mforney.org>
Date:   Tue, 19 Nov 2013 17:23:30 -0800

Move compile/link rules to Makefile.common

Diffstat:
MMakefile.common | 6++++++
Mconfig.mk | 8++++----
Mlaunch/Makefile.local | 7++-----
Mlibswc/Makefile.local | 14+++-----------
4 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/Makefile.common b/Makefile.common @@ -12,5 +12,11 @@ install-$(dir): .deps/$(dir): @mkdir -p "$@" +$(dir)/%.o: $(dir)/%.c | .deps/$(dir) + $(compile) $($(@D)_CFLAGS) $($(@D)_PACKAGE_CFLAGS) + +$(dir)/%.lo: $(dir)/%.c | .deps/$(dir) + $(compile) -fPIC $($(@D)_CFLAGS) $($(@D)_PACKAGE_CFLAGS) + CLEAN_FILES += $($(dir)_TARGETS) diff --git a/config.mk b/config.mk @@ -27,8 +27,8 @@ SWC_PACKAGES = \ LAUNCH_PACKAGES = \ libdrm -SWC_PACKAGE_CFLAGS = $$($(PKG_CONFIG) --cflags $(SWC_PACKAGES)) -SWC_PACKAGE_LIBS = $$($(PKG_CONFIG) --libs $(SWC_PACKAGES)) -LAUNCH_PACKAGE_CFLAGS = $$($(PKG_CONFIG) --cflags $(LAUNCH_PACKAGES)) -LAUNCH_PACKAGE_LIBS = $$($(PKG_CONFIG) --libs $(LAUNCH_PACKAGES)) +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,11 +4,8 @@ dir := launch $(dir)_TARGETS := $(dir)/swc-launch -$(dir)/launch.o: $(dir)/launch.c - $(compile) $(LAUNCH_PACKAGE_CFLAGS) - -$(dir)/swc-launch: $(dir)/launch.o $(dir)/protocol.static.o - $(link) $(LAUNCH_PACKAGE_LIBS) +$(dir)/swc-launch: $(dir)/launch.o $(dir)/protocol.o + $(link) $(launch_PACKAGE_LIBS) check-dependencies-$(dir): $(call check_deps,swc-launch,$(LAUNCH_PACKAGES)) diff --git a/libswc/Makefile.local b/libswc/Makefile.local @@ -51,25 +51,17 @@ SWC_SOURCES += \ libswc/shell_surface.c \ libswc/binding.c -SWC_SHARED_OBJECTS = $(SWC_SOURCES:%.c=%.shared.o) -SWC_STATIC_OBJECTS = $(SWC_SOURCES:%.c=%.static.o) +SWC_STATIC_OBJECTS = $(SWC_SOURCES:%.c=%.o) +SWC_SHARED_OBJECTS = $(SWC_SOURCES:%.c=%.lo) # Explicitly state dependencies on generated files $(dir)/drm.c $(dir)/drm_buffer.c: protocol/wayland-drm-server-protocol.h -%.shared.o: %.c - @mkdir -p .deps/$(dir $@) - $(compile) -fPIC $(SWC_PACKAGE_CFLAGS) - -%.static.o: %.c - @mkdir -p .deps/$(dir $@) - $(compile) $(SWC_PACKAGE_CFLAGS) - $(dir)/libswc.a: $(SWC_STATIC_OBJECTS) $(call quiet,AR) cru $@ $^ $(dir)/$(LIBSWC_LIB): $(SWC_SHARED_OBJECTS) - $(link) -shared -Wl,-soname,$(LIBSWC_SO) $(SWC_PACKAGE_LIBS) + $(link) -shared -Wl,-soname,$(LIBSWC_SO) $(libswc_PACKAGE_LIBS) $(dir)/$(LIBSWC_SO): $(dir)/$(LIBSWC_LIB) $(call quiet,SYM,ln -sf) $(notdir $<) $@