-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (31 loc) · 1.08 KB
/
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
40
41
42
43
44
45
46
47
48
# ------------------------- Secondary Call ----------------------------------
ifneq ($(KERNELRELEASE),)
#EXTRA_CFLAGS = $(INCLUDES) $(MODFLAGS)
EXTRA_CFLAGS = -g
obj-m := systec_can.o
# ------------------------- Primary Call ------------------------------------
else
.EXPORT_ALL_VARIABLES:
KDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
FW_DIR := /lib/firmware
FIRMWARE_FILES := systec_can-*.fw
# ------------- Default-Target -------------
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
modules_install:
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
@[ -r $(KDIR)/System.map ] || depmod -a $(notdir $(patsubst %/,%,$(dir $(wildcard $(KDIR)))))
firmware_install:
@mkdir -p $(FW_DIR)
@install --mode=644 $(FIRMWARE_FILES) $(FW_DIR)
@echo "Firmware files installed to $(FW_DIR)"
install: modules_install firmware_install
firmware:
$(MAKE) -C hex2bin firmware
dist:
git archive --format=tar --prefix=systec_can/ $(shell git describe) | bzip2 > systec_can-$(shell git describe).tar.bz2
endif
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
.PHONY: all clean