forked from amozzhuhin/struct
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (27 loc) · 616 Bytes
/
Copy pathMakefile
File metadata and controls
37 lines (27 loc) · 616 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
PROJECT = struct-tests
#
# Flags
#
BINDIR = bin
OBJDIR = obj
VPATH = src
C_FILES = tests struct
OBJS = $(addprefix $(OBJDIR)/, $(addsuffix .o, $(C_FILES)))
CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wformat-y2k -Winit-self \
-Wstrict-prototypes -Winline -Wnested-externs -Wbad-function-cast -Wshadow
#
# Targets
#
.PHONY: clean all prepare
prepare:
mkdir -p $(BINDIR)
mkdir -p $(OBJDIR)
clean:
rm $(BINDIR)/$(PROJECT)
rm -r $(BINDIR)
rm $(OBJS)
rm -r $(OBJDIR)
all: prepare $(OBJS)
$(CC) $(OBJS) -o $(BINDIR)/$(PROJECT) $(LDFLAGS)
$(OBJDIR)/%.o: %.c
$(CC) $(CFLAGS) -g -c $^ -o $@