-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 725 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 725 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
CFLAGS=-Wall -Werror
TARGET=router
vpath %.c common
vpath %.h common
OBJDIR = obj
OBJS = $(OBJDIR)/$(TARGET).o \
$(OBJDIR)/logging.o \
$(OBJDIR)/cmd.o \
$(OBJDIR)/line.o \
$(OBJDIR)/serial.o \
$(OBJDIR)/escape.o \
$(OBJDIR)/mqtt.o \
$(OBJDIR)/midpublist.o \
$(OBJDIR)/midsublist.o \
$(OBJDIR)/midunsublist.o \
$(OBJDIR)/addrsublist.o
CFLAGS += -I. -I/usr/local/include
LDFLAGS += -L/usr/local/lib -lmosquitto -lev
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(TARGET)
$(OBJDIR)/%.o : %.c *.h common/*.h
mkdir -p $(OBJDIR)
$(CC) $(CFLAGS) -o $@ -c $<
clean:
rm -rf $(TARGET) $(TARGET).exe $(OBJDIR) *.o