File: top.make

package info (click to toggle)
exactimage 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,940 kB
  • sloc: cpp: 35,715; ansic: 1,730; xml: 1,447; makefile: 323; perl: 138; sh: 108; python: 45; php: 37; ruby: 12
file content (51 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (2)
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
51
# only invoke uname and compute the output top-level dir once
ifndef X_ALREADYLOADED

.PHONY: all
all::

ifndef X_SYSTEM
  X_SYSTEM := $(shell uname -s)
endif
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::
	$(Q)rm -rf $(X_OUTARCH)

.SUFFIXES:

endif