From: John Tsiombikas Date: Sat, 24 Mar 2018 04:42:41 +0000 (+0200) Subject: build windows binary in the same directory X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=044b45b0360db25ad673c8a9b209046df7b60216;p=laserbrain_demo build windows binary in the same directory --- 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