-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 684 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 684 Bytes
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
SOURCES=$(wildcard tools/*.c)
BIN=$(SOURCES:tools/%.c=%)
DESTDIR=/usr/local
DESTBIN=$(SOURCES:tools/%.c=$(DESTDIR)/bin/%)
all: $(BIN)
help:
@printf "+----------------------------+\n"
@printf "| to build a specific tool: |\n"
@printf "| make [tool] |\n"
@printf "| to build all tools: |\n"
@printf "| make |\n"
@printf "+----------------------------+\n"
options:
@echo "OBJ = $(SOURCES)"
@echo "BIN = $(BIN)"
@echo "DESTDIR = $(DESTDIR)"
@echo "DESTBIN = $(DESTBIN)"
build:
mkdir build
%: tools/%.c build
gcc -O3 $< -o build/$@
clean:
rm -rf build
install: all
cp build/* $(DESTDIR)/bin/
uninstall:
rm $(DESTBIN)