-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtop.make
More file actions
50 lines (38 loc) · 1.05 KB
/
Copy pathtop.make
File metadata and controls
50 lines (38 loc) · 1.05 KB
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
# only invoke uname and compute the output top-level dir once
ifndef X_ALREADYLOADED
.PHONY: all
all::
X_SYSTEM := $(shell uname -s)
ifndef X_ARCH
X_ARCH := $(shell uname -m)
endif
#ifndef X_CPUS
# X_CPUS := $(shell (ls -d /sys/devices/system/cpu/cpu* 2>/dev/null || grep '^processor[[:blank:]]:' /proc/cpuinfo) | wc -l)
# ifeq ($(findstring -j,$(MAKEFLAGS)),)
# #MAKEFLAGS += -j $(X_CPUS)
# endif
#endif
X_OUTTOP ?= .
ifndef X_OUTARCH
X_OUTARCH := $(X_OUTTOP)/$(X_SYSTEM)-$(X_ARCH)
endif
endif # X_ALREADYLOADED
# makefiles and module name we are in
X_MAKEFILES := $(filter-out %$.make,$(MAKEFILE_LIST))
X_MODULE := $(patsubst %/,%,$(dir $(word $(words $(X_MAKEFILES)),$(X_MAKEFILES))))
# per module output dir
$(X_MODULE)_OUTPUT := $(X_OUTARCH)/$(X_MODULE)
# create that module output dir
X_IGNORE := $(shell mkdir -p $($(X_MODULE)_OUTPUT))
# initialize
SRCS :=
NOT_SRCS :=
# the global clean target just once
ifndef X_ALREADYLOADED
X_ALREADYLOADED = 1
.PHONY: clean
clean::
@echo "CLEANING $(X_OUTARCH)"
$(Q)rm -rf $(X_OUTARCH)
.SUFFIXES:
endif