]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - Makefile
fixes for progs.src
[xonotic/gmqcc.git] / Makefile
index c6a6327ed02269a35d0146662a6edac6007ccbbc..f227d36cd4c08df63b55d245ce0314417929d287 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,21 @@
+UNAME ?= $(shell uname)
+CYGWIN = $(findstring CYGWIN, $(UNAME))
+MINGW = $(findstring MINGW, $(UNAME))
+
+ifneq ("$(CYGWIN)", "")
+WINDOWS=1
+endif
+ifneq ("$(MINGW)", "")
+WINDOWS=1
+endif
+
 CXX ?= clang++
 CXXFLAGS = \
        -std=c++11 \
        -Wall \
        -Wextra \
+       -Wno-parentheses \
+       -Wno-class-memaccess \
        -fno-exceptions \
        -fno-rtti \
        -MD \
@@ -44,31 +57,44 @@ CDEPS = $(CSRCS:.cpp=.d)
 TDEPS = $(TSRCS:.cpp=.d)
 VDEPS = $(VSRCS:.cpp=.d)
 
+ifndef WINDOWS
 CBIN = gmqcc
-TBIN = testsuite
 VBIN = qcvm
+TBIN = testsuite
+else
+CBIN = gmqcc.exe
+VBIN = qcvm.exe
+endif
 
-all: $(CBIN) $(TBIN) $(VBIN)
+ifndef WINDOWS
+all: $(CBIN) $(QCVM) $(TBIN)
+else
+all: $(CBIN) $(QCVM)
+endif
 
 $(CBIN): $(COBJS)
        $(CXX) $(COBJS) -o $@
 
+$(VBIN): $(VOBJS)
+       $(CXX) $(VOBJS) -o $@
+
+ifndef WINDOWS
 $(TBIN): $(TOBJS)
        $(CXX) $(TOBJS) -o $@
 
-$(VBIN): $(VOBJS)
-       $(CXX) $(VOBJS) -o $@
+test: $(CBIN) $(VBIN) $(TBIN)
+       @./$(TBIN)
+endif
 
 .cpp.o:
        $(CXX) -c $(CXXFLAGS) $< -o $@
 
-test: $(CBIN) $(TBIN) $(VBIN)
-       @./$(TBIN)
-
 clean:
        rm -f *.d
        rm -f $(COBJS) $(CDEPS) $(CBIN)
-       rm -f $(TOBJS) $(TDEPS) $(TBIN)
        rm -f $(VOBJS) $(VDEPS) $(VBIN)
+ifndef WINDOWS
+       rm -f $(TOBJS) $(TDEPS) $(TOBJS)
+endif
 
 -include *.d