forked from contiki-ng/contiki-ng
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.identify-target
26 lines (23 loc) · 922 Bytes
/
Makefile.identify-target
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
# This Makefile can be used to identify the selected TARGET used for a
# specific build. It can be included by example Makefiles that need to take
# decisions based on TARGET. It is also automatically included by the
# top-level Makefile.include. This Makefile also contains basic validation
# of some TARGET-related variables so a faulty make invocation immediately
# stops with a readable error message.
# Build will fail with strange error messages if $(TARGET)/$(BOARD)
# contains trailing whitespace.
ifneq ($(TARGET), $(strip $(TARGET)))
$(error Target name '$(TARGET)' contains trailing whitespace)
endif
ifneq ($(BOARD), $(strip $(BOARD)))
$(error Board name '$(BOARD)' contains trailing whitespace)
endif
ifeq ($(TARGET),)
-include Makefile.target
ifeq ($(TARGET),)
${info TARGET not defined, using target 'native'}
TARGET=native
else
${info using saved target '$(TARGET)'}
endif
endif