From 65a2b83abd5d5e04a60e0c9000195643fa9c7757 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Mon, 14 Oct 2013 02:17:45 -0400 Subject: [PATCH] Cleanup for builds --- BSDmakefile | 21 +++++++-------------- Makefile | 12 ------------ code.c | 2 +- conout.c | 4 +--- exec.c | 2 -- include.mk | 16 +++++++++++----- 6 files changed, 20 insertions(+), 37 deletions(-) diff --git a/BSDmakefile b/BSDmakefile index c5d705a..89fe4f8 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -49,11 +49,8 @@ TESTSUITE = testsuite PAK = gmqpak #standard rules -c.o: ${.IMPSRC} - $(CC) -c ${.IMPSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS) - -exec-standalone.o: exec.c - $(CC) -c ${.ALLSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS) -DQCVM_EXECUTOR=1 +c.o: ${.IMPSRC} + $(CC) -c ${.IMPSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS) $(QCVM): $(OBJ_X) $(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(LIBS) $(OBJ_X) @@ -74,18 +71,14 @@ check: all test: all @ ./$(TESTSUITE) +strip: $(GMQCC) $(QCVM) $(TESTSUITE) + strip $(GMQCC) + strip $(QCVM) + strip $(TESTSUITE) + clean: rm -rf *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 *.exe gm-qcc.tgz ./cov-int -splint: - @ splint $(SPLINTFLAGS) *.c *.h - -gource: - @ gource $(GOURCEFLAGS) - -gource-record: - @ gource $(GOURCEFLAGS) -o - | ffmpeg $(FFMPEGFLAGS) gource.mp4 - depend: @makedepend -Y -f BSDmakefile -w 65536 2> /dev/null ${DEPS:C/\.o/.c/g} diff --git a/Makefile b/Makefile index 96193e7..1205294 100644 --- a/Makefile +++ b/Makefile @@ -85,9 +85,6 @@ endif c.o: $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) -exec-standalone.o: exec.c - $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) -DQCVM_EXECUTOR=1 - $(QCVM): $(OBJ_X) $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) @@ -115,15 +112,6 @@ strip: $(GMQCC) $(QCVM) $(TESTSUITE) clean: rm -rf *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 *.exe gm-qcc.tgz ./cov-int -splint: - @ splint $(SPLINTFLAGS) *.c *.h - -gource: - @ gource $(GOURCEFLAGS) - -gource-record: - @ gource $(GOURCEFLAGS) -o - | ffmpeg $(FFMPEGFLAGS) gource.mp4 - depend: @ makedepend -Y -w 65536 2> /dev/null $(subst .o,.c,$(DEPS)) diff --git a/code.c b/code.c index 05ffe70..e4c2fc1 100644 --- a/code.c +++ b/code.c @@ -37,7 +37,7 @@ */ typedef union { void *enter; - qcint_t leave; + qcint_t leave; } code_hash_entry_t; /* Some sanity macros */ diff --git a/conout.c b/conout.c index c22758b..1d34b16 100644 --- a/conout.c +++ b/conout.c @@ -213,8 +213,7 @@ void con_cprintmsg(lex_ctx_t ctx, int lvl, const char *msgtype, const char *msg, va_end (va); } -#ifndef QCVM_EXECUTOR -/* General error interface */ +/* General error interface: TODO seperate as part of the compiler front-end */ size_t compile_errors = 0; size_t compile_warnings = 0; size_t compile_Werrors = 0; @@ -279,4 +278,3 @@ bool GMQCC_WARN compile_warning(lex_ctx_t ctx, int warntype, const char *fmt, .. va_end(ap); return r; } -#endif diff --git a/exec.c b/exec.c index 57b4731..ebbfa90 100644 --- a/exec.c +++ b/exec.c @@ -587,7 +587,6 @@ cleanup: * main for when building the standalone executor */ -#if defined(QCVM_EXECUTOR) #include const char *type_name[TYPE_COUNT] = { @@ -1226,7 +1225,6 @@ void prog_disasm_function(qc_program_t *prog, size_t id) { ++st; } } -#endif #else /* !QCVM_LOOP */ /* * Everything from here on is not including into the compilation of the diff --git a/include.mk b/include.mk index f95ff7c..d664fb6 100644 --- a/include.mk +++ b/include.mk @@ -20,7 +20,7 @@ COMMON = ansi.o util.o stat.o fs.o opts.o conout.o OBJ_C = $(COMMON) main.o lexer.o parser.o code.o ast.o ir.o ftepp.o utf8.o correct.o fold.o intrin.o OBJ_P = $(COMMON) pak.o OBJ_T = $(COMMON) test.o -OBJ_X = $(COMMON) exec-standalone.o +OBJ_X = $(COMMON) exec.o #gource flags GOURCEFLAGS = \ @@ -111,13 +111,19 @@ uninstall: rm -f $(DESTDIR)$(MANDIR)/man1/doc/qcvm.1 rm -f $(DESTDIR)$(MANDIR)/man1/doc/gmqpak.1 +#style rule STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' -or -name '*.qc' \) -whitespace: +style: find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';' -newline: find . -type f $(STYLE_MATCH) -exec sed -i -e '$$a\' '{}' ';' -indent: find . -type f $(STYLE_MATCH) -exec sed -i 's/\t/ /g' '{}' ';' -style: whitespace newline indent +splint: + @splint $(SPLINTFLAGS) *.c *.h + +gource: + @gource $(GOURCEFLAGS) + +gource-record: + @gource $(GOURCEFLAGS) -o - | ffmpeg $(FFMPEGFLAGS) gource.mp4 -- 2.39.2