-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
39 lines (27 loc) · 804 Bytes
/
Makefile
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
38
39
TARGET := renard-phy-s2lp.a
SRCDIR := src/
OBJDIR := obj/
CFGDIR := conf/
LIBRENARD_DIR := librenard/
LIBRENARD_INCDIR := $(LIBRENARD_DIR)src
LIBRENARD := $(LIBRENARD_DIR)librenard.a
CFLAGS := -I$(LIBRENARD_INCDIR) -I$(CFGDIR) -Wall -std=c99 -Og
ARCHFLAGS :=
SRCS := $(wildcard $(SRCDIR)*.c)
OBJS := $(addprefix $(OBJDIR),$(notdir $(SRCS:.c=.o)))
DEPS := $(addprefix $(OBJDIR),$(notdir $(SRCS:.c=.d)))
all: $(OBJDIR) $(TARGET)
$(LIBRENARD):
$(MAKE) -C $(LIBRENARD_DIR) CC=$(CC) AR=$(AR) ARCHFLAGS="$(ARCHFLAGS)"
$(TARGET): $(OBJS) $(LIBRENARD)
$(AR) crT $@ $^
$(OBJDIR):
mkdir -p $(OBJDIR)
$(OBJDIR)%.o: $(SRCDIR)%.c
$(CC) -c $(ARCHFLAGS) $(CFLAGS) -MMD -MP $< -o $@
clean:
$(MAKE) -C $(LIBRENARD_DIR) clean
$(RM) -r $(TARGET)
$(RM) -r $(OBJDIR)
.PHONY: $(LIBRENARD)
-include $(DEPS)