-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 676 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 676 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
.POSIX: # Parse it an run in POSIX conforming mode
.SUFFIXES: # Delete the default suffixes (inference rules)
CC=gcc
CFLAGS=-g -Wall -Wextra -Wconversion -Wsign-conversion -I$(IDIR)
LDFLAGS=-pthread
OUTPUT=server
ROOTDIR=.
IDIR=$(ROOTDIR)/include
SDIR=$(ROOTDIR)/src
ODIR=$(ROOTDIR)/obj
_DEPS=tcp.h server.h common.h args.h
DEPS=$(addprefix $(IDIR)/,$(_DEPS))
_OBJS=tcp.o server.o args.o
OBJS=$(addprefix $(ODIR)/,$(_OBJS))
$(OUTPUT): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
$(OBJS): | $(ODIR)
$(ODIR):
mkdir $(ODIR)
$(ODIR)/%.o: $(SDIR)/%.c $(DEPS)
$(CC) -c $(CFLAGS) -o $@ $<
.PHONY: clean bear
clean:
rm -rf $(ODIR) $(OUTPUT)
bear: clean
bear -- make