-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (25 loc) · 756 Bytes
/
Makefile
File metadata and controls
37 lines (25 loc) · 756 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
37
# See LICENSE file for copyright and license details.
TOP = .
include config.mak
SRC := $(wildcard $(TOPSRC)/src/*.c $(TOPSRC)/src/core/*.c $(TOPSRC)/src/periph/*.c)
OBJ := $(patsubst $(TOPSRC)/src/%.c,obj/%.o,$(SRC))
override CFLAGS += -I$(TOPSRC)/inc
all: lib/libfe310.a
lib/libfe310.a: $(OBJ)
@mkdir -p $(@D)
$(AR) rcs $@ $^
obj/%.o: $(TOPSRC)/src/%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c -o $@ $<
clean:
@rm -frv obj lib
dist: clean
@rm -fv config.mak
install: all
@mkdir -p $(DESTDIR)$(INCDIR) $(DESTDIR)$(LIBDIR)
@cp -rv $(TOPSRC)/inc/fe310 $(DESTDIR)$(INCDIR)
@cp -v lib/libfe310.a $(DESTDIR)$(LIBDIR)
uninstall:
@rm -frv $(DESTDIR)$(INCDIR)/fe310
@rm -fv $(DESTDIR)$(LIBDIR)/libfe310.a
.PHONY: all clean dist install uninstall