Tools and libraries to glue C/C++ APIs to high-level languages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

51 lines
1.3 KiB

top_srcdir = ../
BUILD_DIR = $(top_srcdir)/bin/Debug
INTEROP_DLL = \
$(BUILD_DIR)/Mono.Cxxi.dll
TEST_DLL = $(BUILD_DIR)/Test.dll
NATIVE = \
MarshalingTests \
InheritanceTests
MANAGED = \
InheritanceTests.cs \
MarshalingTests.cs \
Support/CppNUnitAsserts.cs
REFERENCES = \
-pkg:mono-nunit
NATIVE_SRC = \
$(addprefix Native/,$(NATIVE))
all: $(TEST_DLL)
%.cpp: %.h
%.xml: $(addsuffix .h,$(NATIVE_SRC))
gccxml -fxml=$@ --gccxml-cxxflags -c Native/$*.h
$(BUILD_DIR)/libTest.so: $(addsuffix .cpp,$(NATIVE_SRC))
$(CXX) -fPIC --shared -m32 -o $@ $^
$(BUILD_DIR)/libTest-inline.so: $(addsuffix .cpp,$(NATIVE_SRC))
$(CXX) -fPIC --shared -m32 -fkeep-inline-functions -o $@ $^
generated: $(addsuffix .xml,$(NATIVE))
$(RM) -r generated
$(foreach X,$?, \
mono --debug $(BUILD_DIR)/generator.exe -o=$@ -ns=Tests -lib=Test -inline=surrogatelib $(X) && \
) \
echo Bindings generated successfully.
$(TEST_DLL): generated $(MANAGED) $(BUILD_DIR)/libTest.so $(BUILD_DIR)/libTest-inline.so
mcs -debug -out:$@ -target:library -unsafe $(REFERENCES) -r:$(INTEROP_DLL) generated/*.cs $(MANAGED)
clean:
$(RM) -rf $(TEST_DLL) generated $(BUILD_DIR)/libTest.so $(BUILD_DIR)/libTest-inline.so $(addsuffix .xml,$(NATIVE))
run: $(TEST_DLL)
nunit-console -nologo $(TEST_DLL)