mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-12-03 13:44:05 +00:00
Adjust Makefile for building kvazaar.dll.
Adds targets "kvazaar.dll" and "install-dll" to the Makefile.
This commit is contained in:
parent
e3fbd6d2be
commit
6eb89a2813
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -20,3 +20,5 @@
|
||||||
.kdev4
|
.kdev4
|
||||||
src/kvazaar
|
src/kvazaar
|
||||||
src/libkvazaar.so.*
|
src/libkvazaar.so.*
|
||||||
|
src/kvazaar.dll
|
||||||
|
src/libkvazaar.dll.a
|
||||||
|
|
34
src/Makefile
34
src/Makefile
|
@ -6,17 +6,21 @@ PREFIX = /usr/local
|
||||||
BINDIR = $(PREFIX)/bin
|
BINDIR = $(PREFIX)/bin
|
||||||
INCDIR = $(PREFIX)/include
|
INCDIR = $(PREFIX)/include
|
||||||
LIBDIR = $(PREFIX)/lib
|
LIBDIR = $(PREFIX)/lib
|
||||||
|
DLLDIR = $(BINDIR)
|
||||||
|
|
||||||
PROG = ./kvazaar
|
PROG = ./kvazaar
|
||||||
DEBUG = ./kvazaar_debug
|
DEBUG = ./kvazaar_debug
|
||||||
TESTS = ./kvazaar_tests
|
TESTS = ./kvazaar_tests
|
||||||
LIB = ./libkvazaar.so.0.0.0
|
LIB = ./libkvazaar.so.0.0.0
|
||||||
SONAME = libkvazaar.so.0
|
SONAME = libkvazaar.so.0
|
||||||
|
DLL = ./kvazaar.dll
|
||||||
|
IMPLIB = ./libkvazaar.dll.a
|
||||||
INC = ./kvazaar.h \
|
INC = ./kvazaar.h \
|
||||||
./kvazaar_version.h
|
./kvazaar_version.h
|
||||||
|
|
||||||
# Compilers and other tools
|
# Compilers and other tools
|
||||||
AS = yasm
|
AS = yasm
|
||||||
|
CC = gcc
|
||||||
LD = gcc
|
LD = gcc
|
||||||
INSTALL = install
|
INSTALL = install
|
||||||
|
|
||||||
|
@ -183,11 +187,13 @@ RELEASE_OBJS = $(MAIN_OBJS) $(OBJS)
|
||||||
DEBUG_OBJS = $(RELEASE_OBJS:.o=_debug.o)
|
DEBUG_OBJS = $(RELEASE_OBJS:.o=_debug.o)
|
||||||
TESTS_OBJS = $(TEST_OBJS) $(OBJS)
|
TESTS_OBJS = $(TEST_OBJS) $(OBJS)
|
||||||
|
|
||||||
PROGS = $(PROG) $(DEBUG) $(TESTS)
|
|
||||||
|
|
||||||
DEPS = $(RELEASE_OBJS:.o=.d) $(DEBUG_OBJS:.o=.d) $(TESTS_OBJS:.o=.d)
|
DEPS = $(RELEASE_OBJS:.o=.d) $(DEBUG_OBJS:.o=.d) $(TESTS_OBJS:.o=.d)
|
||||||
|
|
||||||
all: $(PROG) $(LIB)
|
ifneq ( ,$(findstring Windows, $(OS)))
|
||||||
|
all: $(PROG) $(DLL)
|
||||||
|
else
|
||||||
|
all: $(PROG) $(LIB)
|
||||||
|
endif
|
||||||
|
|
||||||
debug: LDFLAGS := $(filter-out -O3 -O2 -flto, $(LDFLAGS))
|
debug: LDFLAGS := $(filter-out -O3 -O2 -flto, $(LDFLAGS))
|
||||||
debug: CFLAGS := $(filter-out -O3 -O2 -flto, $(CFLAGS))
|
debug: CFLAGS := $(filter-out -O3 -O2 -flto, $(CFLAGS))
|
||||||
|
@ -205,6 +211,9 @@ $(PROG): $(RELEASE_OBJS)
|
||||||
$(LIB): $(RELEASE_OBJS)
|
$(LIB): $(RELEASE_OBJS)
|
||||||
$(LD) $^ $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@
|
$(LD) $^ $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@
|
||||||
|
|
||||||
|
$(DLL): $(RELEASE_OBJS)
|
||||||
|
$(LD) $^ $(LDFLAGS) -shared -Wl,--out-implib,$(IMPLIB) -o $@
|
||||||
|
|
||||||
$(DEBUG): $(DEBUG_OBJS)
|
$(DEBUG): $(DEBUG_OBJS)
|
||||||
$(LD) $^ $(LDFLAGS) -o $@
|
$(LD) $^ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
@ -221,7 +230,11 @@ init_submodules:
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
git submodule update
|
||||||
|
|
||||||
install: install-prog install-lib
|
ifneq ( ,$(findstring Windows, $(OS)))
|
||||||
|
install: install-prog install-dll
|
||||||
|
else
|
||||||
|
install: install-prog install-lib
|
||||||
|
endif
|
||||||
|
|
||||||
install-prog: $(PROG)
|
install-prog: $(PROG)
|
||||||
$(INSTALL) -d $(DESTDIR)$(BINDIR)
|
$(INSTALL) -d $(DESTDIR)$(BINDIR)
|
||||||
|
@ -233,8 +246,17 @@ install-lib: $(LIB)
|
||||||
$(INSTALL) -m644 $(INC) -t $(DESTDIR)$(INCDIR)
|
$(INSTALL) -m644 $(INC) -t $(DESTDIR)$(INCDIR)
|
||||||
$(INSTALL) -m644 $(LIB) -t $(DESTDIR)$(LIBDIR)
|
$(INSTALL) -m644 $(LIB) -t $(DESTDIR)$(LIBDIR)
|
||||||
|
|
||||||
|
install-dll: $(DLL)
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(DLLDIR)
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(INCDIR)
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(LIBDIR)
|
||||||
|
$(INSTALL) -m644 $(DLL) -t $(DESTDIR)$(DLLDIR)
|
||||||
|
$(INSTALL) -m644 $(INC) -t $(DESTDIR)$(INCDIR)
|
||||||
|
$(INSTALL) -m644 $(IMPLIB) -t $(DESTDIR)$(LIBDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(RELEASE_OBJS) $(DEBUG_OBJS) $(TESTS_OBJS) $(DEPS) $(PROGS) $(LIB)
|
$(RM) $(RELEASE_OBJS) $(DEBUG_OBJS) $(TESTS_OBJS) $(DEPS)
|
||||||
|
$(RM) $(PROG) $(DEBUG) $(TESTS) $(LIB) $(DLL) $(IMPLIB)
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
@ -244,4 +266,4 @@ endif
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
|
||||||
.PHONY: all clean build_tests tests debug init_submodules
|
.PHONY: all clean build_tests tests debug init_submodules
|
||||||
.PHONY: install install-prog install-lib
|
.PHONY: install install-prog install-lib install-dll
|
||||||
|
|
Loading…
Reference in a new issue