Skip to content

Commit a486d33

Browse files
committed
added makefiles to compile with mingw
1 parent 1f8eb00 commit a486d33

File tree

8 files changed

+35
-3
lines changed

8 files changed

+35
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.o

example/DllLoader/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
*.exe

example/DllLoader/DllLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
typedef int (*addNumberProc)(int, int);
1010

11-
#define DLL_FILE "..\\..\\SampleDLL\\Debug\\SampleDLL.dll"
11+
#define DLL_FILE "..\\SampleDLL\\SampleDLL.dll"
1212

1313
void LoadFromFile(void)
1414
{

example/DllLoader/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CC = gcc
2+
CPP = g++
3+
LINK = ld
4+
CFLAGS = -Wall -g
5+
LDFLAGS =
6+
7+
OBJ = DllLoader.o ../../MemoryModule.o
8+
9+
DllLoader.exe: $(OBJ)
10+
$(CC) $(LDFLAGS) -o DllLoader.exe $(OBJ)
11+
12+
%.o: %.cpp
13+
$(CPP) $(CFLAGS) -c $<
14+
15+
%.o: %.cc
16+
$(CC) $(CFLAGS) -c $<

example/SampleDLL/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
*.dll

example/SampleDLL/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CC = g++
2+
CFLAGS = -Wall -g -DSAMPLEDLL_EXPORTS
3+
LDFLAGS = -shared
4+
5+
OBJ = SampleDLL.o
6+
7+
SampleDLL.dll: $(OBJ)
8+
$(CC) $(LDFLAGS) -o SampleDLL.dll $(OBJ)
9+
10+
%.o: %.cpp
11+
$(CC) $(CFLAGS) -c $<

example/SampleDLL/SampleDLL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ SAMPLEDLL_API int addNumbers(int a, int b)
77
return a + b;
88
}
99

10-
}
10+
}

example/SampleDLL/SampleDLL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ extern "C" {
88

99
SAMPLEDLL_API int addNumbers(int a, int b);
1010

11-
}
11+
}

0 commit comments

Comments
 (0)