build windows binary in the same directory
[laserbrain_demo] / Makefile
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)