diff options
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | Makefile | 12 | ||||
| -rwxr-xr-x | scripts/gen-deps | 5 | ||||
| -rw-r--r-- | src/ast.c | 8 |
4 files changed, 19 insertions, 10 deletions
@@ -1,5 +1,5 @@ deps.mk docs/output build -cu -!include/cu +ek +!include/ek @@ -3,6 +3,7 @@ DO != echo -n > deps.mk DEBUGFLAGS != [ $(RELEASE) ] && echo "-flto=auto -O2 -DNODEBUG" || echo "-O0 -g -DDEBUG" CFLAGS = -Wall -Wextra DEPFLAGS = -MT $@ -MMD -MP -MF $@.d +LINTFLAGS = -fsyntax-only INCLUDEFLAGS = -Iinclude COMPILEFLAGS = LINKFLAGS = @@ -23,16 +24,19 @@ include gen/source.mk COMPILE = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS)\ $(CFLAGS) $(DEPFLAGS) $(COMPILEFLAGS) $(INCLUDEFLAGS) +LINT = $(COMPILE) $(LINTFLAGS) + OBJS != ./scripts/gen-deps --sources "$(SOURCES)" include deps.mk +.PHONY: lint +lint: $(OBJS:.o=.o.l) + .PHONY: format format: - @cd src; find . -iname '*.[ch]' |\ - xargs -n 10 -P 0 uncrustify -c ../uncrustify.conf --no-backup -F - - @cd include; find . -iname '*.[ch]' |\ - xargs -n 10 -P 0 uncrustify -c ../uncrustify.conf --no-backup -F - + @find src include tests -iname '*.[ch]' |\ + xargs -n 10 -P 0 uncrustify -c uncrustify.conf --no-backup -F - .PHONY: license license: diff --git a/scripts/gen-deps b/scripts/gen-deps index befd25d..0feed7e 100755 --- a/scripts/gen-deps +++ b/scripts/gen-deps @@ -1,17 +1,22 @@ #!/bin/sh gencommon () { + lint="build/${s%.*}${1}.l" dep="build/${s%.*}${1}.d" obj="build/${s%.*}${1}" echo "${dep}:" >> deps.mk echo "include ${dep}" >> deps.mk + echo "${obj}: ${s}" >> deps.mk } genobjs () { gencommon ".o" echo "${obj}: ${s}" >> deps.mk echo " \$(COMPILE) -c $< -o \$@" >> deps.mk + + echo "${lint}: ${s}" >> deps.mk + echo " \$(LINT) -c ${s} -o /dev/null" >> deps.mk } case "${1}" in @@ -1701,22 +1701,22 @@ struct ast_node *clone_ast_node(struct ast_node *node) switch (node->_type.kind) { case AST_TYPE_GENERIC: new = gen_type(AST_TYPE_GENERIC, - clone_ast_node(node->_type.generic.id), + clone_ast_node(node->_type.generic.id), clone_ast_node(node->_type.generic.args), NULL); break; case AST_TYPE_MEMBER: new = gen_type(AST_TYPE_MEMBER, - clone_ast_node(node->_type.member.id), + clone_ast_node(node->_type.member.id), clone_ast_node(node->_type.member.expr), NULL); break; case AST_TYPE_ALIAS: new = gen_type(AST_TYPE_ALIAS, NULL, - /* should make it more obvious what is a - * reference and what isn't */ + /* should make it more obvious what is a + * reference and what isn't */ node->_type.alias.alias, node->_type.alias.actual); break; |
