build windows binary in the same directory
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 24 Mar 2018 04:42:41 +0000 (06:42 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 24 Mar 2018 04:42:41 +0000 (06:42 +0200)
.gitignore
Makefile
Makefile.mingw [new file with mode: 0644]

index 5c76780..698475d 100644 (file)
@@ -12,3 +12,12 @@ data/
 Debug/
 Release/
 imgui.ini
+*.gz
+backupdatasrc/
+datasrc/
+*.conf
+*.log
+*.ppm
+*.font
+*.glyphmap
+origfbx/
index d9eb6a7..a3e49a2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,9 @@ libal_Darwin = -framework OpenAL
 libal_mingw = -lopenal
 
 ifeq ($(sys), mingw)
+       obj = $(src:.cc=.w32.o) $(csrc:.c=.w32.o)
+       dep     = $(obj:.o=.d)
+
        bin = demo.exe
        LDFLAGS += -lmingw32 -lSDL2main -lSDL2 -lwinmm -mwindows
        #CFLAGS += -DGLEW_STATIC
@@ -69,6 +72,12 @@ run: instalien
 %.d: %.cc
        @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
 
+%.w32.o: %.c
+       $(CC) -o $@ $(CFLAGS) -c $<
+
+%.w32.o: %.cc
+       $(CC) -o $@ $(CXXFLAGS) -c $<
+
 .PHONY: clean
 clean:
        rm -f $(obj) $(bin)
diff --git a/Makefile.mingw b/Makefile.mingw
new file mode 100644 (file)
index 0000000..c28eb18
--- /dev/null
@@ -0,0 +1,5 @@
+CC=i686-w64-mingw32-gcc
+CXX=i686-w64-mingw32-g++
+sys=mingw
+
+include Makefile