]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Cleanup for builds
authorDale Weiler <killfieldengine@gmail.com>
Mon, 14 Oct 2013 06:17:45 +0000 (02:17 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Mon, 14 Oct 2013 06:17:45 +0000 (02:17 -0400)
BSDmakefile
Makefile
code.c
conout.c
exec.c
include.mk

index c5d705af92a5df3146cf8b865ec324dfc88c4136..89fe4f82cecd21ab6baaefca5353ff9190547d37 100644 (file)
@@ -49,11 +49,8 @@ TESTSUITE = testsuite
 PAK       = gmqpak
 
 #standard rules
 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)
 
 $(QCVM): $(OBJ_X)
        $(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(LIBS) $(OBJ_X)
@@ -74,18 +71,14 @@ check: all
 test: all
        @ ./$(TESTSUITE)
 
 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
 
 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}
 
 depend:
        @makedepend -Y -f BSDmakefile -w 65536 2> /dev/null ${DEPS:C/\.o/.c/g}
 
index 96193e76abfa6175aca2ffcc013e69cfad6af5f8..1205294b547ff4fc7b63b9d670ebe8fbe892ba52 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -85,9 +85,6 @@ endif
 c.o:
        $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
 
 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)
 
 $(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
 
 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))
 
 depend:
        @ makedepend -Y -w 65536 2> /dev/null $(subst .o,.c,$(DEPS))
 
diff --git a/code.c b/code.c
index 05ffe70ca3561a73fdb37645b042f04953ba86e4..e4c2fc13fdaa553fb4a15d5dbb90e51c3558073c 100644 (file)
--- a/code.c
+++ b/code.c
@@ -37,7 +37,7 @@
  */
 typedef union {
     void   *enter;
  */
 typedef union {
     void   *enter;
-    qcint_t   leave;
+    qcint_t leave;
 } code_hash_entry_t;
 
 /* Some sanity macros */
 } code_hash_entry_t;
 
 /* Some sanity macros */
index c22758be9c178a43a7ac61617405a7124fcd7b4f..1d34b164842a54731ba3499642f3dba875094e61 100644 (file)
--- 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);
 }
 
     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;
 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;
 }
     va_end(ap);
     return r;
 }
-#endif
diff --git a/exec.c b/exec.c
index 57b47318fab3211a8d269db944933ad26eeb95ee..ebbfa903f217cab55a179fcde2ebe66972697a1a 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -587,7 +587,6 @@ cleanup:
  * main for when building the standalone executor
  */
 
  * main for when building the standalone executor
  */
 
-#if defined(QCVM_EXECUTOR)
 #include <math.h>
 
 const char *type_name[TYPE_COUNT] = {
 #include <math.h>
 
 const char *type_name[TYPE_COUNT] = {
@@ -1226,7 +1225,6 @@ void prog_disasm_function(qc_program_t *prog, size_t id) {
         ++st;
     }
 }
         ++st;
     }
 }
-#endif
 #else /* !QCVM_LOOP */
 /*
  * Everything from here on is not including into the compilation of the
 #else /* !QCVM_LOOP */
 /*
  * Everything from here on is not including into the compilation of the
index f95ff7cb697c91c82633ec0af99368bbca97834f..d664fb65bd7124e142412dd6275476cb484a9645 100644 (file)
@@ -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_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 =                 \
 
 #gource flags
 GOURCEFLAGS =                 \
@@ -111,13 +111,19 @@ uninstall:
        rm -f $(DESTDIR)$(MANDIR)/man1/doc/qcvm.1
        rm -f $(DESTDIR)$(MANDIR)/man1/doc/gmqpak.1
 
        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' \)
 
 STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' -or -name '*.qc' \)
 
-whitespace:
+style:
        find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';'
        find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';'
-newline:
        find . -type f $(STYLE_MATCH) -exec sed -i -e '$$a\' '{}' ';'
        find . -type f $(STYLE_MATCH) -exec sed -i -e '$$a\' '{}' ';'
-indent:
        find . -type f $(STYLE_MATCH) -exec sed -i 's/\t/    /g' '{}' ';'
 
        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