Cleanup for builds

This commit is contained in:
Dale Weiler 2013-10-14 02:17:45 -04:00
parent 19331ee385
commit 65a2b83abd
6 changed files with 20 additions and 37 deletions

View file

@ -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}

View file

@ -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))

2
code.c
View file

@ -37,7 +37,7 @@
*/
typedef union {
void *enter;
qcint_t leave;
qcint_t leave;
} code_hash_entry_t;
/* Some sanity macros */

View file

@ -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

2
exec.c
View file

@ -587,7 +587,6 @@ cleanup:
* main for when building the standalone executor
*/
#if defined(QCVM_EXECUTOR)
#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;
}
}
#endif
#else /* !QCVM_LOOP */
/*
* Everything from here on is not including into the compilation of the

View 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_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