From a486d330f2887c8610302fd2b17efa4909ba6786 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Sun, 24 Oct 2010 00:37:53 +0200 Subject: [PATCH] added makefiles to compile with mingw --- .gitignore | 1 + example/DllLoader/.gitignore | 2 ++ example/DllLoader/DllLoader.cpp | 2 +- example/DllLoader/Makefile | 16 ++++++++++++++++ example/SampleDLL/.gitignore | 2 ++ example/SampleDLL/Makefile | 11 +++++++++++ example/SampleDLL/SampleDLL.cpp | 2 +- example/SampleDLL/SampleDLL.h | 2 +- 8 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 example/DllLoader/.gitignore create mode 100644 example/DllLoader/Makefile create mode 100644 example/SampleDLL/.gitignore create mode 100644 example/SampleDLL/Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5761abc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.o diff --git a/example/DllLoader/.gitignore b/example/DllLoader/.gitignore new file mode 100644 index 0000000..0393442 --- /dev/null +++ b/example/DllLoader/.gitignore @@ -0,0 +1,2 @@ +*.o +*.exe \ No newline at end of file diff --git a/example/DllLoader/DllLoader.cpp b/example/DllLoader/DllLoader.cpp index f51c31b..d849b46 100644 --- a/example/DllLoader/DllLoader.cpp +++ b/example/DllLoader/DllLoader.cpp @@ -8,7 +8,7 @@ typedef int (*addNumberProc)(int, int); -#define DLL_FILE "..\\..\\SampleDLL\\Debug\\SampleDLL.dll" +#define DLL_FILE "..\\SampleDLL\\SampleDLL.dll" void LoadFromFile(void) { diff --git a/example/DllLoader/Makefile b/example/DllLoader/Makefile new file mode 100644 index 0000000..182118d --- /dev/null +++ b/example/DllLoader/Makefile @@ -0,0 +1,16 @@ +CC = gcc +CPP = g++ +LINK = ld +CFLAGS = -Wall -g +LDFLAGS = + +OBJ = DllLoader.o ../../MemoryModule.o + +DllLoader.exe: $(OBJ) + $(CC) $(LDFLAGS) -o DllLoader.exe $(OBJ) + +%.o: %.cpp + $(CPP) $(CFLAGS) -c $< + +%.o: %.cc + $(CC) $(CFLAGS) -c $< diff --git a/example/SampleDLL/.gitignore b/example/SampleDLL/.gitignore new file mode 100644 index 0000000..41f4fda --- /dev/null +++ b/example/SampleDLL/.gitignore @@ -0,0 +1,2 @@ +*.o +*.dll diff --git a/example/SampleDLL/Makefile b/example/SampleDLL/Makefile new file mode 100644 index 0000000..86c82d1 --- /dev/null +++ b/example/SampleDLL/Makefile @@ -0,0 +1,11 @@ +CC = g++ +CFLAGS = -Wall -g -DSAMPLEDLL_EXPORTS +LDFLAGS = -shared + +OBJ = SampleDLL.o + +SampleDLL.dll: $(OBJ) + $(CC) $(LDFLAGS) -o SampleDLL.dll $(OBJ) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< diff --git a/example/SampleDLL/SampleDLL.cpp b/example/SampleDLL/SampleDLL.cpp index bc21282..342d371 100644 --- a/example/SampleDLL/SampleDLL.cpp +++ b/example/SampleDLL/SampleDLL.cpp @@ -7,4 +7,4 @@ SAMPLEDLL_API int addNumbers(int a, int b) return a + b; } -} \ No newline at end of file +} diff --git a/example/SampleDLL/SampleDLL.h b/example/SampleDLL/SampleDLL.h index 9bc0f94..2662c3c 100644 --- a/example/SampleDLL/SampleDLL.h +++ b/example/SampleDLL/SampleDLL.h @@ -8,4 +8,4 @@ extern "C" { SAMPLEDLL_API int addNumbers(int a, int b); -} \ No newline at end of file +}