2013-06-16 07:08:07 +00:00
|
|
|
#
|
|
|
|
# This is the Makefile for the BSD flavor
|
|
|
|
#
|
2013-06-16 08:21:23 +00:00
|
|
|
.include "include.mk"
|
2013-06-16 07:08:07 +00:00
|
|
|
|
|
|
|
GITTEST != git describe --always 2>/dev/null
|
2013-08-16 07:33:57 +00:00
|
|
|
VALTEST != valgrind --version 2>/dev/null
|
2013-06-16 07:08:07 +00:00
|
|
|
GITINFO :=
|
|
|
|
|
|
|
|
.if $(GITTEST)
|
|
|
|
GITINFO != git describe --always
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if $(CC) == clang
|
|
|
|
CFLAGS += -Weverything\
|
|
|
|
-Wno-padded\
|
|
|
|
-Wno-format-nonliteral\
|
|
|
|
-Wno-disabled-macro-expansion\
|
|
|
|
-Wno-conversion\
|
|
|
|
-Wno-float-equal\
|
|
|
|
-Wno-unknown-warning-option\
|
2013-06-18 07:26:07 +00:00
|
|
|
-Wno-cast-align\
|
2014-05-24 14:04:14 +00:00
|
|
|
-Wno-assign-enum\
|
2014-09-29 00:28:56 +00:00
|
|
|
-Wno-empty-body\
|
|
|
|
-Wno-date-time\
|
2013-08-16 03:28:02 +00:00
|
|
|
-pedantic-errors
|
2013-06-16 07:08:07 +00:00
|
|
|
.else
|
2013-08-16 03:28:02 +00:00
|
|
|
. if $(CC) != g++
|
|
|
|
CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
|
|
|
|
. endif
|
|
|
|
|
|
|
|
. if $(CC) != tcc
|
|
|
|
CFLAGS += -pedantic-errors
|
2013-06-16 07:08:07 +00:00
|
|
|
. else
|
|
|
|
CFLAGS += -Wno-pointer-sign -fno-common
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
2013-08-16 07:33:57 +00:00
|
|
|
.if !$(VALTEST)
|
|
|
|
CFLAGS += -DNVALGRIND
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2013-08-16 03:28:02 +00:00
|
|
|
CFLAGS += -DGMQCC_GITINFO=\"$(GITINFO)\" $(OPTIONAL)
|
2013-06-16 08:21:23 +00:00
|
|
|
DEPS != for i in $(OBJ_C) $(OBJ_P) $(OBJ_T) $(OBJ_X); do echo $$i; done | sort | uniq
|
2013-06-16 07:08:07 +00:00
|
|
|
|
|
|
|
QCVM = qcvm
|
|
|
|
GMQCC = gmqcc
|
|
|
|
TESTSUITE = testsuite
|
2013-06-16 07:21:40 +00:00
|
|
|
PAK = gmqpak
|
2013-06-16 07:08:07 +00:00
|
|
|
|
|
|
|
#standard rules
|
2013-10-14 06:17:45 +00:00
|
|
|
c.o: ${.IMPSRC}
|
|
|
|
$(CC) -c ${.IMPSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS)
|
2013-06-16 07:08:07 +00:00
|
|
|
|
|
|
|
$(QCVM): $(OBJ_X)
|
|
|
|
$(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(LIBS) $(OBJ_X)
|
|
|
|
|
|
|
|
$(GMQCC): $(OBJ_C)
|
|
|
|
$(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(LIBS) $(OBJ_C)
|
|
|
|
|
|
|
|
$(TESTSUITE): $(OBJ_T)
|
|
|
|
$(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(LIBS) $(OBJ_T)
|
|
|
|
|
|
|
|
$(PAK): $(OBJ_P)
|
|
|
|
$(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(OBJ_P)
|
|
|
|
|
|
|
|
all: $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK)
|
|
|
|
|
|
|
|
check: all
|
|
|
|
@ ./$(TESTSUITE)
|
|
|
|
test: all
|
|
|
|
@ ./$(TESTSUITE)
|
|
|
|
|
2013-10-14 06:17:45 +00:00
|
|
|
strip: $(GMQCC) $(QCVM) $(TESTSUITE)
|
|
|
|
strip $(GMQCC)
|
|
|
|
strip $(QCVM)
|
|
|
|
strip $(TESTSUITE)
|
|
|
|
|
2013-06-16 07:08:07 +00:00
|
|
|
clean:
|
2013-06-22 00:16:44 +00:00
|
|
|
rm -rf *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 *.exe gm-qcc.tgz ./cov-int
|
2013-06-16 07:08:07 +00:00
|
|
|
|
2013-06-16 08:21:23 +00:00
|
|
|
depend:
|
|
|
|
@makedepend -Y -f BSDmakefile -w 65536 2> /dev/null ${DEPS:C/\.o/.c/g}
|
|
|
|
|
2013-06-22 00:15:25 +00:00
|
|
|
coverity:
|
|
|
|
@cov-build --dir cov-int $(MAKE) -f BSDmakefile
|
|
|
|
@tar czf gm-qcc.tgz cov-int
|
|
|
|
@rm -rf cov-int
|
|
|
|
@echo gm-qcc.tgz generated, submit for analysis
|
|
|
|
|
2013-06-16 07:08:07 +00:00
|
|
|
install: install-gmqcc install-qcvm install-gmqpak install-doc
|
|
|
|
install-gmqcc: $(GMQCC)
|
|
|
|
install -d -m755 $(DESTDIR)$(BINDIR)
|
|
|
|
install -m755 $(GMQCC) $(DESTDIR)$(BINDIR)/$(GMQCC)
|
|
|
|
install-qcvm: $(QCVM)
|
|
|
|
install -d -m755 $(DESTDIR)$(BINDIR)
|
|
|
|
install -m755 $(QCVM) $(DESTDIR)$(BINDIR)/$(QCVM)
|
|
|
|
install-gmqpak: $(PAK)
|
|
|
|
install -d -m755 $(DESTDIR)$(BINDIR)
|
|
|
|
install -m755 $(PAK) $(DESTDIR)$(BINDIR)/$(PAK)
|
|
|
|
install-doc:
|
|
|
|
install -d -m755 $(DESTDIR)$(MANDIR)/man1
|
|
|
|
install -m644 doc/gmqcc.1 $(DESTDIR)$(MANDIR)/man1/
|
|
|
|
install -m644 doc/qcvm.1 $(DESTDIR)$(MANDIR)/man1/
|
|
|
|
install -m644 doc/gmqpak.1 $(DESTDIR)$(MANDIR)/man1/
|
|
|
|
|
|
|
|
# DO NOT DELETE
|
|
|
|
|
2013-10-11 12:10:32 +00:00
|
|
|
ansi.o: platform.h gmqcc.h opts.def
|
|
|
|
ast.o: gmqcc.h opts.def ast.h ir.h parser.h lexer.h
|
|
|
|
code.o: gmqcc.h opts.def
|
2013-08-01 07:07:59 +00:00
|
|
|
conout.o: gmqcc.h opts.def
|
2013-10-11 12:10:32 +00:00
|
|
|
correct.o: gmqcc.h opts.def
|
2013-10-17 08:27:34 +00:00
|
|
|
exec.o: gmqcc.h opts.def
|
2013-10-11 12:10:32 +00:00
|
|
|
fold.o: ast.h ir.h gmqcc.h opts.def parser.h lexer.h
|
|
|
|
fs.o: gmqcc.h opts.def platform.h
|
|
|
|
ftepp.o: gmqcc.h opts.def lexer.h
|
2013-12-14 06:23:39 +00:00
|
|
|
hash.o: gmqcc.h opts.def
|
2013-10-11 12:10:32 +00:00
|
|
|
intrin.o: parser.h gmqcc.h opts.def lexer.h ast.h ir.h
|
|
|
|
ir.o: gmqcc.h opts.def ir.h
|
|
|
|
lexer.o: gmqcc.h opts.def lexer.h
|
|
|
|
main.o: gmqcc.h opts.def lexer.h
|
2013-06-16 07:08:07 +00:00
|
|
|
opts.o: gmqcc.h opts.def
|
|
|
|
pak.o: gmqcc.h opts.def
|
2013-08-14 06:12:43 +00:00
|
|
|
parser.o: parser.h gmqcc.h opts.def lexer.h ast.h ir.h
|
2013-10-11 12:10:32 +00:00
|
|
|
stat.o: gmqcc.h opts.def
|
|
|
|
test.o: gmqcc.h opts.def platform.h
|
2013-06-16 07:23:51 +00:00
|
|
|
utf8.o: gmqcc.h opts.def
|
2013-10-11 12:10:32 +00:00
|
|
|
util.o: gmqcc.h opts.def platform.h
|