From beec2705b1d5013c8c1b0b04f64f996a0e5022ee Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Fri, 31 Jul 2015 15:51:53 +0300 Subject: [PATCH] Add cli, lib-shared and lib-static to Makefile. --- .travis-script.sh | 2 +- src/Makefile | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.travis-script.sh b/.travis-script.sh index 8c22b025..194eb9e9 100755 --- a/.travis-script.sh +++ b/.travis-script.sh @@ -7,7 +7,7 @@ if [ -n "$VALGRIND_TEST" ]; then valgrind --leak-check=full --error-exitcode=1 ./kvazaar_debug -i ../mandelbrot_${TEST_DIM}.yuv --input-res=${TEST_DIM} -o /dev/null $VALGRIND_TEST elif [ -n "$EXPECTED_STATUS" ]; then cd src - make + make cli set +e ./kvazaar $PARAMS EXIT_STATUS=$? diff --git a/src/Makefile b/src/Makefile index be9c6243..60402efe 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,8 @@ # Simple Makefile for Kvazaar HEVC encoder +all: cli lib-shared +.PHONY: all + # Installation locations DESTDIR = PREFIX = /usr/local @@ -85,7 +88,7 @@ ifeq ($(SYSTEM), Windows) ASFLAGS += -DHAVE_ALIGNED_STACK=0 endif CFLAGS += -D__USE_MINGW_ANSI_STDIO=1 - ALL_TARGETS = $(PROG) $(DLL) + LIBKVAZAAR_SHARED = $(DLL) INSTALL_TARGETS += install-dll # OS X specific flags @@ -96,7 +99,7 @@ else ifeq ($(SYSTEM), Darwin) ASFLAGS += -f macho32 endif ASFLAGS += -DPREFIX - ALL_TARGETS = $(PROG) $(DYLIB) + LIBKVAZAAR_SHARED = $(DYLIB) INSTALL_TARGETS += install-dylib # Default to Linux/elf specific flags @@ -107,7 +110,7 @@ else else ASFLAGS += -f elf32 endif - ALL_TARGETS = $(PROG) $(LIB) + LIBKVAZAAR_SHARED = $(LIB) INSTALL_TARGETS += install-lib endif @@ -223,7 +226,10 @@ TESTS_OBJS = $(TEST_OBJS) $(OBJS) DEPS = $(RELEASE_OBJS:.o=.d) $(DEBUG_OBJS:.o=.d) $(TESTS_OBJS:.o=.d) -all: $(ALL_TARGETS) +.PHONY: cli lib-shared lib-static debug tests build_tests +cli: $(PROG) +lib-shared: $(LIBKVAZAAR_SHARED) +lib-static: # TODO debug: LDFLAGS := $(filter-out -O3 -O2 -flto, $(LDFLAGS)) debug: CFLAGS := $(filter-out -O3 -O2 -flto, $(CFLAGS)) @@ -277,6 +283,8 @@ $(TESTS): $(TESTS_OBJS) $(CC) -fpic $(CFLAGS) $(EXTRA_FLAGS) -MMD -MP -c $< -o $@ +.PHONY: kvazaar.pc init_submodules install install-pc install-prog install-lib +.PHONY: install-dylib install-dll clean kvazaar.pc: kvazaar.pc.in Makefile sed -e "s;@prefix@;$(PREFIX);" -e "s;@libdir@;$(LIBDIR);" \ -e "s;@VERSION@;$(VER_MAJOR).$(VER_MINOR).$(VER_RELEASE);" \