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 @@ |
|||||||
|
|
||||||
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 |
if ENABLE_DEBUG |
||||||
SUBDIRS = src |
SUBDIRS += tests |
||||||
endif |
|
||||||
if ENABLE_RELEASE |
|
||||||
SUBDIRS = src |
|
||||||
endif |
endif |
||||||
|
@ -1,29 +1,37 @@ |
|||||||
|
|
||||||
top_srcdir=../.. |
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 |
$(CXX) -fPIC --shared -o $@ Hello.cpp |
||||||
|
|
||||||
Hello.xml: Hello.h |
Hello.xml: Hello.h |
||||||
gccxml -fxml=$@ Hello.h |
gccxml -fxml=$@ Hello.h |
||||||
|
|
||||||
output gen: |
generated: Hello.xml |
||||||
$(RM) -r output |
$(RM) -r generated |
||||||
mono $(top_srcdir)/src/generator/bin/Debug/generator.exe -ns=Hello -lib=hello Hello.xml |
mono $(BUILD_DIR)/generator.exe -ns=Hello -lib=hello -o=$@ 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 |
|
||||||
|
|
||||||
Hello.exe: HelloBinding.dll Hello.cs |
$(HELLO_EXE): generated Hello.cs |
||||||
$(GMCS) -out:$@ -target:exe -r:$(INTEROP_DLL) -r:HelloBinding.dll Hello.cs |
$(GMCS) -out:$@ -target:exe -r:$(INTEROP_DLL) generated/*.cs Hello.cs |
||||||
|
|
||||||
clean: |
clean: |
||||||
$(RM) -r output libhello.so Hello.xml Hello.exe HelloBinding.dll |
$(RM) -r generated libhello.so Hello.xml $(HELLO_EXE) |
||||||
|
|
||||||
run: 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 @@ |
|||||||
|
|
||||||
if ENABLE_DEBUG |
SUBDIRS = Hello |
||||||
SUBDIRS = Hello |
|
||||||
endif |
|
||||||
if ENABLE_RELEASE |
|
||||||
SUBDIRS = Hello |
|
||||||
endif |
|
||||||
|
@ -1,10 +1,2 @@ |
|||||||
|
|
||||||
EXTRA_DIST = expansions.m4 |
SUBDIRS = Mono.VisualC.Interop Mono.VisualC.Code generator |
||||||
|
|
||||||
#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 |
|
||||||
|
@ -1,31 +1,44 @@ |
|||||||
top_srcdir = ../ |
top_srcdir = ../ |
||||||
|
BUILD_DIR = $(top_srcdir)/bin/Debug |
||||||
|
|
||||||
INTEROP_DLL = \
|
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 |
HDR = \
|
||||||
gccxml -fxml=$@ --gccxml-cxxflags -c test.h |
Native/test.h |
||||||
|
|
||||||
libTest.so: test.h test.cpp |
NATIVE = \
|
||||||
g++ -fPIC --shared -o $@ test.cpp |
Native/NUnit.cpp \
|
||||||
|
Native/test.cpp |
||||||
|
|
||||||
libTest-inline.so: test.h test.cpp |
MANAGED = \
|
||||||
g++ -fPIC --shared -fkeep-inline-functions -o $@ test.cpp |
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 |
generated: test.xml |
||||||
$(RM) -r generated |
$(RM) -r generated |
||||||
mono --debug $(top_srcdir)/src/generator2/bin/Debug/generator.exe -o=generated -ns=CppTests -lib=Test test.xml |
mono --debug $(BUILD_DIR)/generator.exe -o=$@ -ns=CppTests -lib=Test test.xml |
||||||
|
|
||||||
CppTestBinding.dll: generated |
|
||||||
mcs -out:$@ -target:library -unsafe -r:$(INTEROP_DLL) generated/*.cs |
|
||||||
|
|
||||||
test.exe: test.cs TestDriver.cs CppTestBinding.dll libTest.so libTest-inline.so |
$(TEST_DLL): generated $(MANAGED) $(BUILD_DIR)/libTest.so $(BUILD_DIR)/libTest-inline.so |
||||||
mcs -out:$@ -target:exe -r:$(INTEROP_DLL) -r:CppTestBinding.dll test.cs TestDriver.cs |
mcs -out:$@ -target:library -unsafe -r:$(INTEROP_DLL) generated/*.cs $(MANAGED) |
||||||
|
|
||||||
clean: |
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 |
run: $(TEST_DLL) |
||||||
MONO_PATH=$(top_srcdir)/src/Mono.VisualC.Interop/bin/Debug mono test.exe |
nunit-console -nologo $(TEST_DLL) |
Loading…
Reference in new issue