-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 726 Bytes
/
Copy pathMakefile
File metadata and controls
32 lines (23 loc) · 726 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
BUILD_DIR := build
UTILS_PATH ?= ../utils
CPPFLAGS := -I$(UTILS_PATH)
CFLAGS := -Wall -Wextra
CFLAGS += -ggdb -O0
LDLIBS := -lpthread
SRCS:= ring_buffer.c producer.c consumer.c packet.c $(UTILS_PATH)/log/log.c
HDRS := $(patsubst %.c,%.h,$(SRCS))
OBJS := $(patsubst %.c,%.o,$(SRCS))
.PHONY: all pack clean always
all: firewall serial
firewall: $(OBJS) firewall.o
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDLIBS)
serial: $(OBJS) serial.o
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDLIBS)
$(UTILS_PATH)/log/log.o: $(UTILS_PATH)/log/log.c $(UTILS_PATH)/log/log.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
pack: clean
-rm -f ../src.zip
zip -r ../src.zip *
clean:
-rm -f $(OBJS) serial.o firewall.o
-rm -f firewall serial