forked from Mellanox/mlxbf-bootctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (26 loc) · 809 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
PROJECT_NAME:=mlxbf-bootctl
SBINDIR = /sbin
# Default target.
all:
include $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))/package.mk
# By default, use the Makefile's directory as the vpath.
VPATH := $(dir $(lastword $(MAKEFILE_LIST)))
CFLAGS += -O2 -g -std=gnu99 -Werror \
-Wall -Wshadow -Wuninitialized -Wstrict-overflow -Wundef \
-Wold-style-definition -Wwrite-strings
LDFLAGS += -Wl,--fatal-warnings
SOURCES := \
mlxbf-bootctl.c \
# Grab dependencies, if they exist.
-include $(SOURCES:.c=.d)
%.o: %.c
$(CC) $(CFLAGS) -MD -MP -c -o $@ $<
mlxbf-bootctl: $(SOURCES:.c=.o)
$(CC) $(LDFLAGS) -o $@ $^
all: mlxbf-bootctl
install: mlxbf-bootctl
mkdir -p $(DESTDIR)$(SBINDIR)
cp -f mlxbf-bootctl $(DESTDIR)$(SBINDIR)
clean:
rm -f *.d *.o mlxbf-bootctl
.PHONY: all install clean