From 044b45b0360db25ad673c8a9b209046df7b60216 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sat, 24 Mar 2018 06:42:41 +0200 Subject: [PATCH] build windows binary in the same directory --- .gitignore | 9 +++++++++ Makefile | 9 +++++++++ Makefile.mingw | 5 +++++ 3 files changed, 23 insertions(+) create mode 100644 Makefile.mingw diff --git a/.gitignore b/.gitignore index 5c76780..698475d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,12 @@ data/ Debug/ Release/ imgui.ini +*.gz +backupdatasrc/ +datasrc/ +*.conf +*.log +*.ppm +*.font +*.glyphmap +origfbx/ diff --git a/Makefile b/Makefile index d9eb6a7..a3e49a2 100644 --- 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 index 0000000..c28eb18 --- /dev/null +++ b/Makefile.mingw @@ -0,0 +1,5 @@ +CC=i686-w64-mingw32-gcc +CXX=i686-w64-mingw32-g++ +sys=mingw + +include Makefile -- 1.7.10.4