File: Makefile.mingw

package info (click to toggle)
swish-e 2.4.5-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,044 kB
  • ctags: 7,630
  • sloc: ansic: 47,771; sh: 8,968; perl: 3,170; makefile: 587; xml: 9
file content (77 lines) | stat: -rwxr-xr-x 2,421 bytes parent folder | download
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/make -f
#
# File: Makefile.mingw
# Desc: Build SWISH::API for ActivePerl/Win32 on Linux using 
#       WINE, ActivePerl, and MinGW
#

# Some brief notes on how to setup a build environment:
# 1.) Install mingw (Debian: mingw32, mingw32-runtime, mingw32-binutils)
# 2.) Install WINE (Debian: wine)
# 3.) Install xvfb dummy X server (Debian: xvfb)
# 4.) Install ActivePerl on Windows (or WINE if you can)
# 5.) Copy over the entire Perl tree to Linux (e.g. C:\Perl)
# 6.) Run the Perl/bin/reloc_perl script to correct the runtime Prefix.
# 7.) Make sure that your WINE install sets up a binfmt handler
#     for Windows executables.  (Debian wine does) 
# 8.) Note: you may wish/need to rebuild Debian wine with debugging 
#     disabled.  WINE debug output is printed to stdout.  (Why? Why?)
#     Also you need to comment out the "Wine exited with successful status"
#     line in /usr/bin/wine to prevent corruption of API.c

# SWISH-E "install" Location
SWISH_PREFIX = ../../prefix
SWISH_BIN = $(SWISH_PREFIX)/bin/swish-e.exe

# PERL Location (Need WINE and ActivePerl on Linux)
PERL_PREFIX = ../../perl
PERL_BIN = xvfb-run /usr/bin/wine $(PERL_PREFIX)/bin/perl.exe
PERL_LIB = $(PERL_PREFIX)/bin/perl58.dll

# Compiler Stuff
CC=i586-mingw32msvc-gcc
LIBS=../src/.libs/libswish-e.dll.a $(PERL_LIB)

# OS Commands
CP = cp -f
MKDIR = mkdir -p
TOUCH = touch 

# Perl module directories
INST_LIB = blib/lib
INST_ARCHLIB = blib/arch
API_DLL = $(INST_ARCHLIB)/auto/SWISH/API/API.dll

$(API_DLL): API.c
	$(MKDIR) $(INST_ARCHLIB)/auto/SWISH/API
	$(MKDIR) $(INST_LIB)/SWISH
	$(CC) -shared -o $(API_DLL) -I ../../perl/lib/CORE -I ../src API.c $(LIBS)
	$(TOUCH) $(INST_ARCHLIB)/auto/SWISH/API/API.bs
	$(CP) API.pm $(INST_LIB)/SWISH

API.c:
	$(PERL_BIN) $(PERL_PREFIX)/lib/ExtUtils/xsubpp -noprototypes -typemap $(PERL_PREFIX)/lib/ExtUtils/typemap -typemap typemap API.xs > API.c


TEST_VERBOSE=1
TEST_TYPE=test_$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES = t/test.t
TEST_CONF = t/test.conf
TEST_DB = t/index.swish-e
TESTDB_SW = -d

test: $(API_DLL) index.swish-e
	# Ugh. API.dll needs pcre, zlib, libxml2, libswish-e, etc.
	$(CP) ../../test/*.dll $(INST_ARCHLIB)/auto/SWISH/API
	$(PERL_BIN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)


index.swish-e:
	$(SWISH_BIN) -c $(TEST_CONF) -f $(TEST_DB) -v0


clean:
	rm -fr API.c API.dll t/index.swish-e* blib