Support compilation using MinGW on Linux.

This commit is contained in:
Joachim Bauch
2013-03-05 01:02:09 +01:00
parent d9a3b23830
commit 1cc307a883
2 changed files with 25 additions and 5 deletions
+14 -3
View File
@@ -1,11 +1,22 @@
CC = g++
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
CC = i686-w64-mingw32-gcc
CXX = i686-w64-mingw32-g++
LINK = i686-w64-mingw32-ld
else
CC = gcc
CXX = g++
LINK = ld
endif
CFLAGS = -Wall -g -DSAMPLEDLL_EXPORTS
LDFLAGS = -shared
OBJ = SampleDLL.o
SampleDLL.dll: $(OBJ)
$(CC) $(LDFLAGS) -o SampleDLL.dll $(OBJ)
$(LINK) $(LDFLAGS) -o SampleDLL.dll $(OBJ)
%.o: %.cpp
$(CC) $(CFLAGS) -c $<
$(CXX) $(CFLAGS) -c $<