This repository has been archived by the owner on Jan 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
104 lines (80 loc) · 2.99 KB
/
Makefile
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
CURSES=ncurses
MONO_CURSES=mono-curses
SOURCES = \
AssemblyInfo.cs \
handles.cs \
binding.cs \
gui.cs \
constants.cs
EXTRA_DIST = \
mono-curses.snk \
configure \
Makefile \
binding.cs.in \
attrib.c \
mono-curses.c \
mono-curses.source \
mono-curses.pc.in
DOCS_DIST = \
docs/ns-Mono.Terminal.xml \
docs/index.xml
all: config.make mono-curses.dll libmono-curses.so mono-curses.zip mono-curses.pc
test.exe: test.cs mono-curses.dll libmono-curses.so
gmcs -debug test.cs -r:mono-curses.dll
mono-curses.pc: mono-curses.pc.in Makefile
sed -e 's,@PREFIX@,$(prefix),' -e 's/@VERSION@/$(VERSION)/' < mono-curses.pc.in > mono-curses.pc
mono-curses.dll mono-curses.xml: $(SOURCES)
gmcs -doc:mono-curses.xml -debug -target:library -out:mono-curses.dll -debug $(SOURCES)
#
mono-curses.tree mono-curses.zip: mono-curses.xml mono-curses.dll docs/ns-Mono.Terminal.xml docs/index.xml
monodocer -importslashdoc:mono-curses.xml -path:docs -assembly:mono-curses.dll
mdassembler --ecma docs/ --out mono-curses
binding.cs: binding.cs.in Makefile
if test `uname` = Darwin; then make t-bugosx; else make detect; fi
t-bugosx:
make binding CURSES=libncurses.dylib MONO_CURSES=libmono-curses.dylib
#cute hack to avoid depending on ncurses-devel on Linux
detect:
echo "main () {initscr();}" > tmp.c
gcc tmp.c -lncurses -o tmp
make binding CURSES=`ldd ./tmp | grep ncurses | awk '{print $$3}' | sed 's#.*libncurses#ncurses#'`
binding:
sed -e 's/@CURSES@/$(CURSES)/' -e 's/@MONO_CURSES@/$(MONO_CURSES)/' < binding.cs.in > binding.cs
constants.cs: attrib.c
gcc -o attrib attrib.c -lncurses
./attrib constants.cs
libmono-curses.so: mono-curses.c
if test `uname` = Darwin; then gcc -dynamiclib -m32 mono-curses.c -o libmono-curses.dylib -lncurses; else gcc -g -shared -fPIC mono-curses.c -o libmono-curses.so -lncurses; fi
test: test.exe
mono test.exe
clean:
-rm -f *.exe *dll binding.cs *.so *dylib
install: all
mkdir -p $(prefix)/bin
mkdir -p $(prefix)/lib/mono-curses
mkdir -p $(prefix)/lib/pkgconfig
gacutil -i mono-curses.dll -package mono-curses -root $(DESTDIR)$(prefix)/lib
cp libmono-curses* $(prefix)/lib/
cp mono-curses.pc $(prefix)/lib/pkgconfig/
cp mono-curses.tree mono-curses.zip mono-curses.source `pkg-config --variable sourcesdir monodoc`
config.make:
echo You must run configure first
exit 1
include config.make
dist:
rm -rf mono-curses-$(VERSION)
mkdir mono-curses-$(VERSION)
mkdir mono-curses-$(VERSION)/docs
cp -a $(SOURCES) $(EXTRA_DIST) mono-curses-$(VERSION)
cp -a $(DOCS_DIST) mono-curses-$(VERSION)/docs
tar czvf mono-curses-$(VERSION).tar.gz mono-curses-$(VERSION)
rm -rf mono-curses-$(VERSION)
distcheck: dist
rm -rf test
(mkdir test; cd test; tar xzvf ../mono-curses-$(VERSION).tar.gz; cd mono-curses-$(VERSION); \
./configure --prefix=$$(cd `pwd`/..; pwd); \
make && make install && make dist);
rm -rf test
echo mono-curses-$(VERSION).tar.gz is ready for release
push:
scp mono-curses.tree mono-curses.zip mono-curses.source root@www.go-mono.com:/usr/lib/monodoc/sources/