mirror of https://github.com/mono/CppSharp.git
Browse Source
+ Rewrite / clean up makefiles. + Enable makefile integration in MD to keep everything in sync.pull/1/head
13 changed files with 193 additions and 164 deletions
@ -1,10 +1,8 @@
@@ -1,10 +1,8 @@
|
||||
|
||||
EXTRA_DIST = expansions.m4 |
||||
EXTRA_DIST = m4/expansions.m4 |
||||
|
||||
SUBDIRS = src examples |
||||
|
||||
#Warning: This is an automatically generated file, do not edit!
|
||||
if ENABLE_DEBUG |
||||
SUBDIRS = src |
||||
endif |
||||
if ENABLE_RELEASE |
||||
SUBDIRS = src |
||||
SUBDIRS += tests |
||||
endif |
||||
|
@ -1,29 +1,37 @@
@@ -1,29 +1,37 @@
|
||||
|
||||
top_srcdir=../.. |
||||
|
||||
all: libhello.so Hello.xml Hello.exe |
||||
if ENABLE_DEBUG |
||||
BUILD_DIR=$(top_srcdir)/bin/Debug |
||||
endif |
||||
|
||||
libhello.so: Hello.cpp Hello.h |
||||
if ENABLE_RELEASE |
||||
BUILD_DIR=$(top_srcdir)/bin/Release |
||||
endif |
||||
|
||||
INTEROP_DLL = \
|
||||
$(BUILD_DIR)/Mono.VisualC.Interop.dll |
||||
|
||||
HELLO_EXE = \
|
||||
$(BUILD_DIR)/Hello.exe |
||||
|
||||
all: $(BUILD_DIR)/libhello.so Hello.xml $(HELLO_EXE) |
||||
|
||||
$(BUILD_DIR)/libhello.so: Hello.cpp Hello.h |
||||
$(CXX) -fPIC --shared -o $@ Hello.cpp |
||||
|
||||
Hello.xml: Hello.h |
||||
gccxml -fxml=$@ Hello.h |
||||
|
||||
output gen: |
||||
$(RM) -r output |
||||
mono $(top_srcdir)/src/generator/bin/Debug/generator.exe -ns=Hello -lib=hello Hello.xml |
||||
|
||||
INTEROP_DLL = \
|
||||
$(top_srcdir)/src/Mono.VisualC.Interop/bin/Debug/Mono.VisualC.Interop.dll |
||||
|
||||
HelloBinding.dll: output |
||||
$(GMCS) -out:$@ -target:library -r:$(INTEROP_DLL) output/*.cs |
||||
generated: Hello.xml |
||||
$(RM) -r generated |
||||
mono $(BUILD_DIR)/generator.exe -ns=Hello -lib=hello -o=$@ Hello.xml |
||||
|
||||
Hello.exe: HelloBinding.dll Hello.cs |
||||
$(GMCS) -out:$@ -target:exe -r:$(INTEROP_DLL) -r:HelloBinding.dll Hello.cs |
||||
$(HELLO_EXE): generated Hello.cs |
||||
$(GMCS) -out:$@ -target:exe -r:$(INTEROP_DLL) generated/*.cs Hello.cs |
||||
|
||||
clean: |
||||
$(RM) -r output libhello.so Hello.xml Hello.exe HelloBinding.dll |
||||
$(RM) -r generated libhello.so Hello.xml $(HELLO_EXE) |
||||
|
||||
run: Hello.exe |
||||
MONO_PATH=$(top_srcdir)/src/Mono.VisualC.Interop/bin/Debug mono Hello.exe |
||||
mono --debug $(HELLO_EXE) |
||||
|
@ -1,7 +1,2 @@
@@ -1,7 +1,2 @@
|
||||
|
||||
if ENABLE_DEBUG |
||||
SUBDIRS = Hello |
||||
endif |
||||
if ENABLE_RELEASE |
||||
SUBDIRS = Hello |
||||
endif |
||||
SUBDIRS = Hello |
||||
|
@ -1,10 +1,2 @@
@@ -1,10 +1,2 @@
|
||||
|
||||
EXTRA_DIST = expansions.m4 |
||||
|
||||
#Warning: This is an automatically generated file, do not edit!
|
||||
if ENABLE_DEBUG |
||||
SUBDIRS = Mono.VisualC.Interop QtBindings Mono.VisualC.Code generator QtTest |
||||
endif |
||||
if ENABLE_RELEASE |
||||
SUBDIRS = Mono.VisualC.Interop QtBindings Mono.VisualC.Code generator QtTest |
||||
endif |
||||
SUBDIRS = Mono.VisualC.Interop Mono.VisualC.Code generator |
||||
|
@ -1,31 +1,44 @@
@@ -1,31 +1,44 @@
|
||||
top_srcdir = ../ |
||||
BUILD_DIR = $(top_srcdir)/bin/Debug |
||||
|
||||
INTEROP_DLL = \
|
||||
$(top_srcdir)/src/Mono.VisualC.Interop/bin/Debug/Mono.VisualC.Interop.dll |
||||
$(BUILD_DIR)/Mono.VisualC.Interop.dll |
||||
|
||||
all: test.exe |
||||
TEST_DLL = $(BUILD_DIR)/Test.dll |
||||
|
||||
test.xml: test.h |
||||
gccxml -fxml=$@ --gccxml-cxxflags -c test.h |
||||
HDR = \
|
||||
Native/test.h |
||||
|
||||
libTest.so: test.h test.cpp |
||||
g++ -fPIC --shared -o $@ test.cpp |
||||
NATIVE = \
|
||||
Native/NUnit.cpp \
|
||||
Native/test.cpp |
||||
|
||||
libTest-inline.so: test.h test.cpp |
||||
g++ -fPIC --shared -fkeep-inline-functions -o $@ test.cpp |
||||
MANAGED = \
|
||||
Support/CppMockObject.cs \
|
||||
Support/CppNUnitAsserts.cs \
|
||||
test.cs |
||||
|
||||
|
||||
all: $(TEST_DLL) |
||||
|
||||
test.xml: $(HDR) |
||||
gccxml -fxml=$@ --gccxml-cxxflags -c $(HDR) |
||||
|
||||
$(BUILD_DIR)/libTest.so: $(HEADERS) $(NATIVE) |
||||
g++ -fPIC --shared -o $@ $(NATIVE) |
||||
|
||||
$(BUILD_DIR)/libTest-inline.so: $(HEADERS) $(NATIVE) |
||||
g++ -fPIC --shared -fkeep-inline-functions -o $@ $(NATIVE) |
||||
|
||||
generated: test.xml |
||||
$(RM) -r generated |
||||
mono --debug $(top_srcdir)/src/generator2/bin/Debug/generator.exe -o=generated -ns=CppTests -lib=Test test.xml |
||||
|
||||
CppTestBinding.dll: generated |
||||
mcs -out:$@ -target:library -unsafe -r:$(INTEROP_DLL) generated/*.cs |
||||
mono --debug $(BUILD_DIR)/generator.exe -o=$@ -ns=CppTests -lib=Test test.xml |
||||
|
||||
test.exe: test.cs TestDriver.cs CppTestBinding.dll libTest.so libTest-inline.so |
||||
mcs -out:$@ -target:exe -r:$(INTEROP_DLL) -r:CppTestBinding.dll test.cs TestDriver.cs |
||||
$(TEST_DLL): generated $(MANAGED) $(BUILD_DIR)/libTest.so $(BUILD_DIR)/libTest-inline.so |
||||
mcs -out:$@ -target:library -unsafe -r:$(INTEROP_DLL) generated/*.cs $(MANAGED) |
||||
|
||||
clean: |
||||
$(RM) -rf CppTestBinding.dll test.exe generated libTest.so libTest-inline.so test.xml |
||||
$(RM) -rf $(TEST_DLL) generated $(BUILD_DIR)/libTest.so $(BUILD_DIR)/libTest-inline.so test.xml |
||||
|
||||
run: test.exe |
||||
MONO_PATH=$(top_srcdir)/src/Mono.VisualC.Interop/bin/Debug mono test.exe |
||||
run: $(TEST_DLL) |
||||
nunit-console -nologo $(TEST_DLL) |
Loading…
Reference in new issue