Make the ranlib and ar executables configurable. Support for setting the cross-compilation tool names easily.

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@53 a6f86f6d-0131-4f8e-9e7b-e335508773d5
This commit is contained in:
Moritz Bunkus 2010-03-23 15:08:11 +00:00
parent a65901063d
commit 35942a7134

View File

@ -16,10 +16,13 @@ SHARED = yes
ifeq (yes,$(DEBUG))
DEBUGFLAGS=-g -DDEBUG
endif
CXX = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
CROSS =
CXX = $(CROSS)g++
CC = $(CROSS)gcc
WINDRES = $(CROSS)windres
RANLIB = $(CROSS)ranlib
AR = $(CROSS)ar
RES =
SRC = $(wildcard ../../src/*.cpp)
OBJ = $(patsubst %.cpp,%.o,$(SRC))
ifeq (yes,$(SHARED))
@ -29,7 +32,7 @@ else
LIBS = libebml.a
endif
INCS = -I../..
CXXFLAGS += $(DEBUGFLAGS) $(INCS)
CXXFLAGS += $(DEBUGFLAGS) $(INCS)
.PHONY: all all-before all-after clean clean-custom
@ -47,8 +50,8 @@ distclean dist-clean: clean
rm -f .depend
libebml.a: $(OBJ)
ar r $@ $(OBJ)
ranlib $@
$(AR) r $@ $(OBJ)
$(RANLIB) $@
libebml.dll: $(OBJ)
$(CXX) -shared -Wl,--export-all -Wl,--out-implib=$@.a -o $@ $(OBJ)