-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (24 loc) · 785 Bytes
/
Makefile
File metadata and controls
36 lines (24 loc) · 785 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
CC := gcc
CFLAGS := -std=c99 -Wall -Wextra -Wpedantic -Wshadow# -ggdb3 -fsanitize=address,leak,undefined -fstack-protector-strong
LDLIBS :=
# TODO: Add object files and rename
SRC := main.c
OBJ := $(addprefix obj/, $(addsuffix .o, $(SRC)))
BIN := output.out
# TODO: Remove install target when not necessary
PREFIX := /usr/local
BINDIR := $(PREFIX)/bin
#-------------------------------------------------------------------------------
.PHONY: all clean install
all: $(BIN)
clean:
rm -f $(OBJ)
rm -f $(BIN)
install: $(BIN)
install -D -m 755 $^ -t $(DESTDIR)$(BINDIR)
#-------------------------------------------------------------------------------
$(BIN): $(OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
obj/%.c.o : src/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -o $@ -c $<