aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/hal.mk
blob: ae27ea5467926ba8dbaea1e7484b160a756439cd (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
include ${CHIBIOS}/os/hal/hal.mk

ifeq ($(USE_SMART_BUILD),yes)

# Configuration files directory
ifeq ($(CONFDIR),)
  CONFDIR = .
endif

HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h $(CONFDIR)/halconf_community.h | egrep -e "\#define"))

HALSRC_CONTRIB := ${CHIBIOS_CONTRIB}/os/hal/src/hal_community.c
ifneq ($(findstring HAL_USE_NAND TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_nand.c
endif
ifneq ($(findstring HAL_USE_ONEWIRE TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_onewire.c
endif
ifneq ($(findstring HAL_USE_EICU TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_eicu.c
endif
ifneq ($(findstring HAL_USE_CRC TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_crc.c
endif
ifneq ($(findstring HAL_USE_RNG TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_rng.c
endif
ifneq ($(findstring HAL_USE_USBH TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_debug.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_desciter.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_hub.c
endif
ifneq ($(findstring HAL_USBH_USE_MSD TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_msd.c
endif
ifneq ($(findstring HAL_USBH_USE_FTDI TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh_ftdi.c 
endif
ifneq ($(findstring HAL_USBH_USE_AOA TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh_aoa.c 
endif
ifneq ($(findstring HAL_USBH_USE_HID TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh_hid.c 
endif
ifneq ($(findstring HAL_USBH_USE_UVC TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_uvc.c
endif
ifneq ($(findstring HAL_USE_EEPROM TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_eeprom.c
ifneq ($(findstring EEPROM_USE_EE25XX TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee25xx.c
endif
ifneq ($(findstring EEPROM_USE_EE24XX TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee24xx.c
endif
endif
ifneq ($(findstring HAL_USE_TIMCAP TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_timcap.c
endif
ifneq ($(findstring HAL_USE_QEI TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_qei.c
endif
ifneq ($(findstring HAL_USE_USB_HID TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_hid.c
endif
ifneq ($(findstring HAL_USE_USB_MSD TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_msd.c
endif
ifneq ($(findstring HAL_USE_COMP TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_comp.c
endif
ifneq ($(findstring HAL_USE_OPAMP TRUE,$(HALCONF)),)
HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_opamp.c
endif
else
HALSRC_CONTRIB := ${CHIBIOS_CONTRIB}/os/hal/src/hal_community.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_nand.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_onewire.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_eicu.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_crc.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_rng.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_debug.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_desciter.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_hub.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_msd.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_ftdi.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_aoa.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_hid.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_uvc.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee24xx.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee25xx.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_eeprom.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_timcap.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_qei.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_hid.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_msd.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_comp.c \
                  ${CHIBIOS_CONTRIB}/os/hal/src/hal_opamp.c
endif

HALINC_CONTRIB := ${CHIBIOS_CONTRIB}/os/hal/include

# Shared variables
ALLCSRC += $(HALSRC_CONTRIB)
ALLINC  += $(HALINC_CONTRIB)