-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 824 Bytes
/
Makefile
File metadata and controls
39 lines (28 loc) · 824 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
36
37
38
39
CFLAGS = -std=gnu11 -Wall -Wextra
LDFLAGS = -Wl,--as-needed
ifeq ($(DEBUG), 1)
CFLAGS += -Og -g
else
CFLAGS += -O2
endif
INSTALL = install -Dm755
prefix = /usr/local
bindir = $(prefix)/bin
all:
@echo 'Error, target not specified.'
@make --no-print-directory help
help:
@echo 'Usage:'
@echo ' To compile <filename>.c `make <filename>`'
@echo ' To install <filename> `make target=<filename> install`'
@echo ' To uninstall <filename> `make target=<filename> uninstall`'
@echo ' To clean up `make clean`'
$(DESTDIR)$(bindir)/%: %
$(INSTALL) $^ $(DESTDIR)$(bindir)/$(target)
install: $(DESTDIR)$(bindir)/$(target)
uninstall:
$(RM) "$(DESTDIR)$(bindir)/$(target)"
clean:
find . -mindepth 1 -maxdepth 1 -executable -type f ! -name "prefix_header" -delete
-include *.mk
.PHONY : all install uninstall clean