aboutsummaryrefslogtreecommitdiff
path: root/rules.mk
blob: cc495d60aae248b7214c131198e3f85f358fb458 (plain)
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
# Standard housekeeping
.PHONY: 	all clean install
.SUFFIXES:
.SUFFIXES: 	.c .o

all: targets

# Targets & array of sources & intermediates
SRCS :=
OBJS :=
DEPS :=

LIBS := 
BINS :=

# Iterate through directory tree
DIR := src
include $(DIR)/rules.mk
# ... (repeat)

# Generic rules
%.a: %.o
	$(ARCHIVE)

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
	$(COMPILE)

%: %.o
	$(LINK)

$(OBJ_DIR)/%: $(SRC_DIR)/%.c
	$(COMPLNK)

.PHONY: targets
targets: $(LIBS) $(BINS)

.PHONY: clean
clean:
	rm $(OBJS) $(DEPS) 
	rm $(LIBS) $(BINS)

.PHONY: install
install: targets
	echo "TODO"