File: Makefile.am

package info (click to toggle)
mono-tools 4.2-3.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 13,868 kB
  • sloc: cs: 100,909; sh: 3,845; makefile: 2,040; javascript: 1,557; xml: 126
file content (66 lines) | stat: -rw-r--r-- 2,011 bytes parent folder | download | duplicates (4)
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)
	$(MCS) $(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