Skip to content

Commit

Permalink
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/mmarek/kbuild

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  Kbuild: append missing-syscalls to the default target list
  genksyms: Regenerate lexer and parser
  genksyms: Do not expand internal types
  genksyms: Minor parser cleanup
  Makefile: remove a duplicated line
  fixdep: fix extraneous dependencies
  scripts/Makefile.build: do not reference EXTRA_CFLAGS as CFLAGS replacement
  kbuild: prevent make from deleting _shipped files
  kbuild: Do not delete empty files in make distclean
  • Loading branch information
torvalds committed Nov 7, 2011
2 parents 21404b7 + 5f7efb4 commit dede6fa
Show file tree
Hide file tree
Showing 12 changed files with 404 additions and 332 deletions.
6 changes: 4 additions & 2 deletions Kbuild
Expand Up @@ -88,11 +88,13 @@ $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild
# 3) Check for missing system calls
#

always += missing-syscalls
targets += missing-syscalls

quiet_cmd_syscalls = CALL $<
cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags)

PHONY += missing-syscalls
missing-syscalls: scripts/checksyscalls.sh FORCE
missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
$(call cmd,syscalls)

# Keep these two files during make clean
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Expand Up @@ -983,7 +983,6 @@ archprepare: prepare1 scripts_basic

prepare0: archprepare FORCE
$(Q)$(MAKE) $(build)=.
$(Q)$(MAKE) $(build)=. missing-syscalls

# All the preparing..
prepare: prepare0
Expand Down Expand Up @@ -1198,7 +1197,7 @@ distclean: mrproper
@find $(srctree) $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -size 0 \
-o -name '.*.rej' \
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-type f -print | xargs rm -f

Expand Down Expand Up @@ -1296,7 +1295,6 @@ help:
@echo ' 2: warnings which occur quite often but may still be relevant'
@echo ' 3: more obscure warnings, can most likely be ignored'
@echo ' Multiple levels can be combined with W=12 or W=123'
@echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
@echo ''
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
@echo 'For further info see the ./README file'
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.build
Expand Up @@ -46,7 +46,7 @@ include $(kbuild-file)
# If the save-* variables changed error out
ifeq ($(KBUILD_NOPEDANTIC),)
ifneq ("$(save-cflags)","$(CFLAGS)")
$(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS)
$(error CFLAGS was changed in "$(kbuild-file)". Fix it to use ccflags-y)
endif
endif

Expand Down
4 changes: 4 additions & 0 deletions scripts/Makefile.lib
Expand Up @@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS
quiet_cmd_gperf = GPERF $@
cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<

.PRECIOUS: $(src)/%.hash.c_shipped
$(src)/%.hash.c_shipped: $(src)/%.gperf
$(call cmd,gperf)

Expand All @@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
quiet_cmd_flex = LEX $@
cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<

.PRECIOUS: $(src)/%.lex.c_shipped
$(src)/%.lex.c_shipped: $(src)/%.l
$(call cmd,flex)

Expand All @@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
quiet_cmd_bison = YACC $@
cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<

.PRECIOUS: $(src)/%.tab.c_shipped
$(src)/%.tab.c_shipped: $(src)/%.y
$(call cmd,bison)

quiet_cmd_bison_h = YACC $@
cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<

.PRECIOUS: $(src)/%.tab.h_shipped
$(src)/%.tab.h_shipped: $(src)/%.y
$(call cmd,bison_h)

Expand Down
1 change: 1 addition & 0 deletions scripts/basic/fixdep.c
Expand Up @@ -345,6 +345,7 @@ static void parse_dep_file(void *map, size_t len)
memcpy(s, m, p-m); s[p-m] = 0;
if (strrcmp(s, "include/generated/autoconf.h") &&
strrcmp(s, "arch/um/include/uml-config.h") &&
strrcmp(s, "include/linux/kconfig.h") &&
strrcmp(s, ".ver")) {
/*
* Do not list the source file as dependency, so that
Expand Down
3 changes: 2 additions & 1 deletion scripts/genksyms/genksyms.c
Expand Up @@ -40,7 +40,8 @@ static struct symbol *symtab[HASH_BUCKETS];
static FILE *debugfile;

int cur_line = 1;
char *cur_filename;
char *cur_filename, *source_file;
int in_source_file;

static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types,
flag_preserve, flag_warnings;
Expand Down
4 changes: 3 additions & 1 deletion scripts/genksyms/genksyms.h
Expand Up @@ -37,6 +37,7 @@ enum symbol_status {
struct string_list {
struct string_list *next;
enum symbol_type tag;
int in_source_file;
char *string;
};

Expand All @@ -57,7 +58,8 @@ typedef struct string_list **yystype;
#define YYSTYPE yystype

extern int cur_line;
extern char *cur_filename;
extern char *cur_filename, *source_file;
extern int in_source_file;

struct symbol *find_symbol(const char *name, enum symbol_type ns, int exact);
struct symbol *add_symbol(const char *name, enum symbol_type type,
Expand Down
8 changes: 8 additions & 0 deletions scripts/genksyms/lex.l
Expand Up @@ -116,6 +116,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
cur_node->tag = \
find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
SYM_ENUM_CONST : SYM_NORMAL ; \
cur_node->in_source_file = in_source_file; \
} while (0)
#define APP _APP(yytext, yyleng)
Expand Down Expand Up @@ -166,6 +167,13 @@ repeat:
cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
cur_line = atoi(yytext+2);
if (!source_file) {
source_file = xstrdup(cur_filename);
in_source_file = 1;
} else {
in_source_file = (strcmp(cur_filename, source_file) == 0);
}
goto repeat;
}
Expand Down
12 changes: 10 additions & 2 deletions scripts/genksyms/lex.lex.c_shipped
Expand Up @@ -660,7 +660,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#define ECHO fwrite( yytext, yyleng, 1, yyout )
#endif

/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
Expand All @@ -671,7 +671,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
unsigned n; \
int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
Expand Down Expand Up @@ -1926,6 +1926,7 @@ void yyfree (void * ptr )
cur_node->tag = \
find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
SYM_ENUM_CONST : SYM_NORMAL ; \
cur_node->in_source_file = in_source_file; \
} while (0)

#define APP _APP(yytext, yyleng)
Expand Down Expand Up @@ -1975,6 +1976,13 @@ repeat:
cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
cur_line = atoi(yytext+2);

if (!source_file) {
source_file = xstrdup(cur_filename);
in_source_file = 1;
} else {
in_source_file = (strcmp(cur_filename, source_file) == 0);
}

goto repeat;
}

Expand Down

0 comments on commit dede6fa

Please sign in to comment.