Commit 77af0368 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

make: Add scripts/Makefile.rules

This helpers will be used in rules generation
for new make infrastructure.

At moment only a few helpers here -- to compile
*.c and *.S files, and generate *.d,*.s,*.i files.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent ad4f28ca
##
##
## These are per-file generators.
##
define gen-rule-o-from-c-by-name
$(1).o: $(1).c
$$(E) " CC " $$@
$$(Q) $$(CC) -c $$(CFLAGS) $(2) $$< -o $$@
endef
define gen-rule-i-from-c-by-name
$(1).i: $(1).c
$$(E) " CC " $$@
$$(Q) $$(CC) -E $$(CFLAGS) $(2) $$< -o $$@
endef
define gen-rule-s-from-c-by-name
$(1).s: $(1).c
$$(E) " CC " $$@
$$(Q) $$(CC) -S $$(CFLAGS) $(2) -fverbose-asm $$< -o $$@
endef
define gen-rule-o-from-S-by-name
$(1).o: $(1).S
$$(E) " CC " $$@
$$(Q) $$(CC) -c $$(CFLAGS) $(2) $$(ASMFLAGS) $(3) $$< -o $$@
endef
define gen-rule-d-from-c-by-name
$(1).d: $(1).c
$$(E) " DEP " $$@
$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(CFLAGS) $(2) $$< -o $$@
endef
define gen-rule-d-from-S-by-name
$(1).d: $(1).S
$$(E) " DEP " $$@
$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(CFLAGS) $(2) $$< -o $$@
endef
define gen-rule-i-from-S-by-name
$(1).i: $(1).S
$$(E) " CC " $$@
$$(Q) $$(CC) -E $$(CFLAGS) $(2) $$< -o $$@
endef
##
## In case if someone add last resort rule
## together with .SUFFIXES not cleaned, this
## will slow down the build procedure
scripts/Makefile.rules::
@echo > /dev/null
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment