1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
# 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
OPATH = ../win32
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../include $(HAVE) -DHAVE_CONFIG_H -D_GNU_SOURCE
CXXFLAGS = -g -O2 -mthreads
LDFLAGS = -L$(prefix)/dll -lccgnu2 -lws2_32 -lwinmm
#LDEXEC = -L$(OPATH) -lccgnu2 $(LDFLAGS)
DLL_NAME = ccscript2.dll
DLL_LIB = libccscript2.a
DLL_DEF = ccscript.def
all: $(DLL_NAME)
HDRS = ../src/audio.h
OBJS = script.o interp.o locks.o module.o
DLLWRAP_FLAGS = --export-all --output-def $(DLL_DEF) \
--implib $(DLL_LIB) --driver-name $(CXX)
$(DLL_NAME) $(DLL_DEF) $(DLL_LIB): $(addprefix $(OPATH)/, $(OBJS)) libccscript2.o
$(DLLWRAP) $(DLLWRAP_FLAGS) -o $(DLL_NAME) \
$(OBJS) libccscript2.o $(LDFLAGS)
libccscript2.o: ccscript.rc
$(WINDRES) -o libccscript2.o ccscript.rc
$(OPATH)/%.o: %.cpp
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $(OPATH)/$(basename $@).o $<
clean:
-rm -f $(OBJS) $(DLL_NAME) $(DLL_LIB) $(DLL_DEF)
install:
cp -af $(HDRS) $(prefix)/include/cc++2
cp -af $(DLL_LIB) $(DLL_NAME) $(prefix)/dll
cp -af $(DLL_LIB) $(prefix)/lib/libccscript2dll.a
$(STRIP) $(prefix)/dll/$(DLL_NAME)
ar -rs $(prefix)/lib/$(DLL_LIB) $(CCGNU2_OBJS)
|