gmqcc/Makefile

101 lines
1.3 KiB
Makefile
Raw Normal View History

2016-01-03 05:34:29 +00:00
UNAME ?= $(shell uname)
CYGWIN = $(findstring CYGWIN, $(UNAME))
2016-01-03 05:35:12 +00:00
MINGW = $(findstring MINGW, $(UNAME))
2016-01-03 05:34:29 +00:00
ifneq ("$(CYGWIN)", "")
WINDOWS=1
endif
ifneq ("$(MINGW)", "")
WINDOWS=1
endif
2015-01-15 02:48:47 +00:00
CXX ?= clang++
CXXFLAGS = \
-std=c++11 \
-Wall \
-Wextra \
2018-09-01 04:48:18 +00:00
-Wno-parentheses \
-Wno-class-memaccess \
2015-01-15 02:48:47 +00:00
-fno-exceptions \
-fno-rtti \
2015-01-15 04:34:43 +00:00
-MD \
-g3
2012-12-20 00:22:22 +00:00
2015-01-15 02:48:47 +00:00
CSRCS = \
ast.cpp \
code.cpp \
conout.cpp \
fold.cpp \
ftepp.cpp \
intrin.cpp \
ir.cpp \
lexer.cpp \
main.cpp \
opts.cpp \
parser.cpp \
stat.cpp \
utf8.cpp \
util.cpp
2012-11-17 10:00:32 +00:00
2015-01-15 02:48:47 +00:00
TSRCS = \
conout.cpp \
opts.cpp \
stat.cpp \
test.cpp \
util.cpp
2015-01-15 02:48:47 +00:00
VSRCS = \
exec.cpp \
stat.cpp \
util.cpp
COBJS = $(CSRCS:.cpp=.o)
TOBJS = $(TSRCS:.cpp=.o)
VOBJS = $(VSRCS:.cpp=.o)
CDEPS = $(CSRCS:.cpp=.d)
TDEPS = $(TSRCS:.cpp=.d)
VDEPS = $(VSRCS:.cpp=.d)
2016-01-03 05:34:29 +00:00
ifndef WINDOWS
CBIN = gmqcc
2015-01-14 01:36:25 +00:00
VBIN = qcvm
2016-01-03 05:34:29 +00:00
TBIN = testsuite
else
CBIN = gmqcc.exe
2016-01-03 05:38:58 +00:00
VBIN = qcvm.exe
2016-01-03 05:34:29 +00:00
endif
2016-01-03 05:34:29 +00:00
ifndef WINDOWS
all: $(CBIN) $(QCVM) $(TBIN)
else
all: $(CBIN) $(QCVM)
endif
$(CBIN): $(COBJS)
2015-01-15 02:48:47 +00:00
$(CXX) $(COBJS) -o $@
2016-01-03 05:34:29 +00:00
$(VBIN): $(VOBJS)
$(CXX) $(VOBJS) -o $@
ifndef WINDOWS
$(TBIN): $(TOBJS)
2015-01-15 02:48:47 +00:00
$(CXX) $(TOBJS) -o $@
2016-01-03 05:38:58 +00:00
test: $(CBIN) $(VBIN) $(TBIN)
2016-01-03 05:34:29 +00:00
@./$(TBIN)
endif
2015-01-14 01:36:25 +00:00
2015-01-15 02:48:47 +00:00
.cpp.o:
$(CXX) -c $(CXXFLAGS) $< -o $@
2012-11-17 10:00:55 +00:00
2012-04-09 10:42:06 +00:00
clean:
rm -f *.d
rm -f $(COBJS) $(CDEPS) $(CBIN)
2015-01-14 01:36:25 +00:00
rm -f $(VOBJS) $(VDEPS) $(VBIN)
2016-01-03 05:34:29 +00:00
ifndef WINDOWS
rm -f $(TOBJS) $(TDEPS) $(TOBJS)
endif
2015-01-14 01:29:46 +00:00
-include *.d