[CRIU] [PATCH] x86: syscalls -- Rework building procedure

Pavel Emelyanov xemul at parallels.com
Fri Apr 10 04:13:28 PDT 2015


> -$(obj)/$(SYS-EXEC-TBL): $(obj)/$(SYS-GEN) $(obj)/$(SYS-DEF)
> +	$(Q) echo "/* Autogenerated, don't edit */"										>  $@
> +	$(Q) echo "#ifndef __ASM_CR_SYSCALL_CODES_H__"										>> $@
> +	$(Q) echo "#define __ASM_CR_SYSCALL_CODES_H__"										>> $@
> +	$(Q) cat $< | egrep -v '^#' | sed -e 's/\t\{1,\}/|/g' | awk -F '|' '{print "#define " $$1 " " $$2 }'			>> $@

The grep and sed are excessive, just cat | awk '/^__NR/{print "#define", $1, $2}' will work

> +	$(Q) echo "#endif /* __ASM_CR_SYSCALL_CODES_H__ */"									>> $@
> +_all += $(obj)/$(SYS-CODES)
> +cleanup-y += $(obj)/$(SYS-CODES)
> +
> +$(obj)/$(SYS-PROTO): $(obj)/syscalls/$(SYS-DEF)
>  	$(E) "  GEN     " $@
> -	$(Q) $(SH)				\
> -		$(obj)/$(SYS-GEN) --exec	\
> -		$(obj)/$(SYS-DEF)		\
> -		$(obj)/$(SYS-EXEC-TBL)
> +	$(Q) echo "/* Autogenerated, don't edit */"										>  $@
> +	$(Q) echo "#ifndef __ASM_CR_SYSCALL_PROTO_H__"										>> $@
> +	$(Q) echo "#define __ASM_CR_SYSCALL_PROTO_H__"										>> $@
> +	$(Q) echo "#include \"syscall-codes.h\""										>> $@
> +	$(Q) echo "#include \"syscall-types.h\""										>> $@
> +	$(Q) cat $< | egrep -v '^#' | sed -e 's/\t\{1,\}/|/g' | awk -F '|' '{print "extern long ", $$(3), $$(4), ";"}'		>> $@

cat | awk  '/^__NR/{print "extern long", $3, substr($0, index($0,$4))}'

> +	$(Q) echo "#endif /* __ASM_CR_SYSCALL_PROTO_H__ */"									>> $@
> +_all += $(obj)/$(SYS-PROTO)
> +cleanup-y += $(obj)/$(SYS-PROTO)
>  
> +$(obj)/$(SYS-ASM): $(obj)/syscalls/$(SYS-DEF) $(obj)/syscalls/$(SYS-ASM-COMMON) $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
> +	$(E) "  GEN     " $@
> +	$(Q) echo "/* Autogenerated, don't edit */"										>  $@
> +	$(Q) echo "#include \"syscall-codes.h\""										>> $@
> +	$(Q) echo "#include \"syscalls/$(SYS-ASM-COMMON)\""									>> $@
> +	$(Q) cat $< | egrep -v '^#' | sed -e 's/\t\{1,\}/|/g' | awk -F '|' '{print "SYSCALL(", $$3, ",", $$2, ")"}'		>> $@

Only awk here

> +_all += $(obj)/$(SYS-ASM)
> +cleanup-y += $(obj)/$(SYS-ASM)
> +
> +$(obj)/$(SYS-EXEC-TBL): $(obj)/syscalls/$(SYS-DEF) $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
> +	$(E) "  GEN     " $@
> +	$(Q) echo "/* Autogenerated, don't edit */"										>  $@
> +	$(Q) cat $< | egrep -v '^#' | sed -e 's/\t\{1,\}/|/g' | awk -F '|' '{print "SYSCALL(", substr($$3, 5), ",", $$2, ")"}'	>> $@

And here

Please

-- Pavel



More information about the CRIU mailing list