mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 06:02:22 +00:00
Fix makefile
This commit is contained in:
parent
1a18ff5294
commit
5d8c18dcab
1 changed files with 32 additions and 8 deletions
40
Makefile
40
Makefile
|
@ -1,3 +1,14 @@
|
|||
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 \
|
||||
|
@ -44,31 +55,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
|
||||
CVIN = 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: $(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
|
||||
|
|
Loading…
Reference in a new issue