-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (24 loc) · 716 Bytes
/
Makefile
File metadata and controls
36 lines (24 loc) · 716 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 = -Wall -Wextra -Wshadow -g -std=gnu99
ifeq ($(FREEBSD),1)
CFLAGS += -DFREEBSD
else
LFLAGS = -lsctp
endif
COMMON_OBJS = debug.o common.o sctp_auth.o
CLIENT_OBJS = $(COMMON_OBJS) sctp_client.o
CLIENT_NAME = sctp-cli
SERVER_OBJS = $(COMMON_OBJS) sctp_server.o sctp_events.o
SERVER_NAME = sctp-srv
# Header files all modules depend on.
COMMON_HEADERS = src/defs.h src/common.h src/debug.h
.PHONY : all clean cli srv
all : cli srv
cli : $(CLIENT_OBJS)
$(CC) -o $(CLIENT_NAME) $(CLIENT_OBJS) $(LFLAGS)
srv : $(SERVER_OBJS)
$(CC) -o $(SERVER_NAME) $(SERVER_OBJS) $(LFLAGS)
%.o : src/%.c $(COMMON_HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
clean :
rm -f $(CLIENT_NAME) $(SERVER_NAME) *.o core.*