forked from gramineproject/graphene
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.rules
50 lines (38 loc) · 1.07 KB
/
Makefile.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
ifeq ("$(origin V)", "command line")
BUILD_VERBOSE = $(V)
endif
ifndef BUILD_VERBOSE
BUILD_VERBOSE = 0
endif
ifeq ($(BUILD_VERBOSE),1)
quiet =
Q =
else
quiet = quiet_
Q = @
endif
export Q quiet BUILD_VERBOSE
squote := '
escsq = $(subst $(squote),'\$(squote)',$1)
echo-cmd = $(if $($(quiet)cmd_$(1)), echo ' $(call escsq,$($(quiet)cmd_$(1)))';)
cmd = @$(echo-cmd) $(cmd_$(1))
quiet_cmd_asm_offsets_s = [ $@ ]
cmd_asm_offsets_s = $(CC) $(CFLAGS) $(defs) -S $< -o $@
asm-offsets.s: asm-offsets.c $(headers)
$(call cmd,asm_offsets_s)
CLEAN_FILES += asm-offsets.s
quiet_cmd_asm_offsets_h = [ $@ ]
cmd_asm_offsets_h = \
(set -e; \
echo "/* DO NOT MODIFY. THIS FILE WAS AUTO-GENERATED. */"; \
echo "\#ifndef _ASM_OFFSETS_H_"; \
echo "\#define _ASM_OFFSETS_H_"; \
echo ""; \
awk '/\.ascii \" \#define/{val=$$5; gsub("\\$$", "", val); print $$3" "$$4" "val}' $^; \
echo ""; \
echo "\#endif") > $@
asm-offsets.h: asm-offsets.s
$(call cmd,asm_offsets_h)
CLEAN_FILES += asm-offests.h
quiet_cmd_ln_sf = [ $@ ]
cmd_ln_sf = ln -sf $(abspath $<) $@