forked from EtchedPixels/FUZIX
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbake.mk
33 lines (25 loc) · 813 Bytes
/
bake.mk
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
# Load all the build class macros.
include $(wildcard $(BUILD)/classes/*)
find-makefile = \
$(eval DIR := $(dir $(word $(words $(MAKEFILE_LIST)), $(MAKEFILE_LIST))))
# Abusing foreach here gives us local variables.
build = \
$(foreach TARGET,$(strip $1), \
$(foreach CLASS,$(strip $2), \
$(eval TARGETS += $(TARGET)) \
$(eval $(TARGET).class = $(CLASS)) \
$(eval $(TARGET).dir = $(DIR)) \
$(eval $(call $(CLASS).rules,$(TARGET)))))
# Given a path $1 and a list of filenames $2, prepends the path to any relative
# filename in $2 (but leaves absolute paths or $(OBJ)-relative paths alone).
absify = \
$(filter /%, $2) \
$(filter $(OBJ)/%, $2) \
$(addprefix $1, \
$(filter-out /%, \
$(filter-out $(OBJ)/%, $2)))
# Standard targets.
tests:
clean:
.PHONY: tests clean
.DELETE_ON_ERROR: