blob: 136f7d972371dbc27570f22899d15ed1c9880ac0 [file] [log] [blame]
# Copyright (C) 2002 Open Source Telecom Corporation.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# A makefile to do a mingw32 cross compile build of dll's.
VPATH = ../../src:../../demo
OPATH = ../mingw32
ARCH = i586-mingw32msvc-
prefix = /usr/i586-mingw32msvc
CXX = $(ARCH)c++
AS = $(ARCH)as
DLLTOOL = $(ARCH)dlltool
DLLWRAP = $(ARCH)dllwrap
WINDRES = $(ARCH)windres
STRIP = $(ARCH)strip
exeext = .exe
dllext = .dll
CPPFLAGS = -I. -I../../src/ -D_GNU_SOURCE
CXXFLAGS = -include ${prefix}/include/cc++2/cc++/config.h -g -Wall -O2 -mthreads
LDFLAGS = -L$(prefix)/dll -lccrtp1
#-lccgnu2 -lccext2 -lws2_32
CCRTP1_LDFLAGS = -L$(prefix)/dll -lws2_32
#LDEXEC = -L$(OPATH) -lccrtp1 $(LDFLAGS)
CCRTP1_DLL_NAME = ccrtp1.dll
CCRTP1_DLL_LIB = ccrtp1.a
CCRTP1_DLL_DEF = ccrtp1.def
PROGS = rtphello.exe rtpsend.exe rtplisten.exe
all: $(CCRTP1_DLL_NAME) $(PROGS)
SHDRS = base.h formats.h rtppkt.h rtcppkt.h sources.h socket.h \
queuebase.h iqueue.h oqueue.h ioqueue.h cqueue.h
HDRS = $(addprefix ../../src/ccrtp, $(SHDRS))
CCRTP1_OBJS = rtppkt.o rtcppkt.o source.o data.o \
incqueue.o outqueue.o queue.o \
control.o members.o socket.o duplex.o pool.o
CCRTP1_DLLWRAP_FLAGS = --export-all --output-def $(CCRTP1_DLL_DEF) \
--implib $(CCRTP1_DLL_LIB) --driver-name $(CXX)
$(CCRTP1_DLL_NAME) $(CCRTP1_DLL_DEF) $(CCRTP1_DLL_LIB): $(addprefix $(OPATH)/, $(CCRTP1_OBJS))
$(DLLWRAP) $(CCRTP1_DLLWRAP_FLAGS) -o $(CCRTP1_DLL_NAME) \
$(CCRTP1_OBJS) $(CCRTP1_LDFLAGS)
$(OPATH)/%.o: %.cpp
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $(OPATH)/$(basename $@).o $<
%.exe: %.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $< -L. -lccrtp1 $(LDFLAGS) -o $@
clean:
-rm -f $(CCRTP1_OBJS)
$(CCRTP1_DLL_NAME) $(CCRTP1_DLL_LIB) $(CCRTP1_DLL_DEF)
$(PROGS)
install:
-mkdir $(prefix)/include/ccrtp
-mkdir $(prefix)/dll
cp -af $(HDRS) $(prefix)/include/ccrtp
cp -af $(CCRTP1_DLL_LIB) $(CCRTP1_DLL_NAME) $(prefix)/dll
cp -af $(CCRTP1_DLL_LIB) $(prefix)/lib/libccrtp1dll.a
$(STRIP) $(prefix)/dll/$(CCRTP1_DLL_NAME)
ar -rs $(prefix)/lib/$(CCRTP1_DLL_LIB) $(CCRTP1_OBJS)