-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 1.71 KB
/
Copy pathMakefile
File metadata and controls
51 lines (40 loc) · 1.71 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
51
# ==============================================================================
# ASM-LINUX-FRAMEWORK: UNIVERSELE ORCHESTRATOR
# ==============================================================================
# 1. TOOLCHAIN DETECTION & VALIDATION (Evaluated instantly during parsing phase)
PTXAS := $(shell which ptxas 2>/dev/null)
NVDISASM := $(shell which nvdisasm 2>/dev/null)
ifeq ($(PTXAS),)
$(error CRITICAL: 'ptxas' not found in $$PATH. Please install nvidia-cuda-toolkit!)
endif
ifeq ($(NVDISASM),)
$(error CRITICAL: 'nvdisasm' not found in $$PATH. Please install nvidia-cuda-toolkit!)
endif
# 2. DYNAMIC DISCOVERY & PARAMETERS
# Zoekt flexibel naar submappen met een Makefile (tot 2 niveaus diep)
SUBDIRS := $(patsubst %/,%,$(dir $(shell find . -mindepth 2 -maxdepth 2 -name Makefile)))
# Als we op het hoogste niveau starten, setten we de wet voor de PWD.
# Indien al geëxporteerd door een hogere repo, blijft de oorspronkelijke PARENTROOT staan.
ifndef PARENTROOT
export PARENTROOT := $(CURDIR)/
endif
GLOBAL_BUILD := $(PARENTROOT)build
GLOBAL_BIN := $(PARENTROOT)bin
all: debug
# 3. DIRECT EXECUTION LOOP
debug release clean test: directories
@for dir in $(SUBDIRS); do \
echo "=============================================================================="; \
echo "Entering Target Directory: $$dir -> Target: $@"; \
echo "=============================================================================="; \
$(MAKE) -C $$dir $@ || exit 1; \
\
done
# 4. UTILITIES
directories:
@mkdir -p $(GLOBAL_BUILD)
@mkdir -p $(GLOBAL_BIN)
deep_clean:
@echo "Removing centralized build and binary directories..."
rm -rf $(GLOBAL_BUILD) $(GLOBAL_BIN)
.PHONY: all debug release clean test directories deep_clean