blob: fd2394343e098d68cf0225be918599bcc165789d (
plain)
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
|
CNM_FILES = \
create-native-map.cs \
MapAttribute.cs
TM_FILES = \
MapAttribute.cs \
TestMap.cs
cnm_build_sources = $(addprefix $(srcdir)/, $(CNM_FILES))
tm_build_sources = $(addprefix $(srcdir)/, $(TM_FILES))
EXE = ../lib/create-native-map/create-native-map.exe
REFS = -r:Mono.Posix.dll
all: $(EXE)
$(EXE) : $(cnm_build_sources)
$(GMCS) $(MCS_FLAGS) -d:TRACE -debug+ -out:$@ -target:exe $(REFS) $(cnm_build_sources)
assemblydir = $(prefix)/lib/create-native-map
assembly_DATA = $(EXE) MapAttribute.cs
check: $(PROGRAM) TestMap.dll
TestMap.dll: $(tm_build_sources) $(PROGRAM)
$(MCS) -debug+ -out:$@ -t:library $(tm_build_sources)
test_output = test.c test.h test.cs test.xml
$(test_output): TestMap.dll $(EXE)
../bin/create-native-map \
--autoconf-member autoconf_me \
--autoconf-header='<unistd.h>' \
--public-header='<stdlib.h>' \
--public-macro=DefineMe=42 \
--impl-header='<stdio.h>' \
--impl-header='"test.h"' \
--impl-macro='FOO="foo"' \
--exclude-native-symbol=exclude_native_symbol \
--library=NativeLib \
--rename-member=st_atime=st_atime_ \
--rename-namespace=MakeMap.ToBeRenamed=MakeMap_Rename \
$< test
check: $(test_output)
for f in test.c test.h test.cs test.xml ; do \
diff -rup $(srcdir)/$$f.ref $$f ; \
done
check-update:
for f in test.c test.h test.cs test.xml ; do \
mv $$f $$f.ref ; \
done
libtest.so: test.c
gcc -shared -o $@ $^ -I.. `pkg-config --libs --cflags glib-2.0`
test-overflow: test-overflow.c test-overflow.h test.c
gcc -o $@ $< `pkg-config --libs --cflags glib-2.0`
CLEANFILES = $(EXE) $(EXE).mdb $(test_output) TestMap.dll TestMap.dll.mdb libtest.so
EXTRA_DIST = $(CNM_FILES) TestMap.cs test.c.ref test.cs.ref test.h.ref test.xml.ref
|