-
Notifications
You must be signed in to change notification settings - Fork 5
/
application.mk
50 lines (37 loc) · 1 KB
/
application.mk
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
#
# Copyright (C) 2015 Pavel Kirienko <[email protected]>
# Distributed under the terms of the MIT license.
#
LOCAL_DIR := $(abspath $(realpath $(dir $(lastword $(MAKEFILE_LIST)))))
EXEC ?= firmware.exe
PGM ?= ${ARCH}/$(EXEC)
MANAGERS ?= all
#
# RTEMS makefiles
#
ifndef RTEMS_MAKEFILE_PATH
$(error RTEMS environment is not configured. Have you sourced env.sh?)
endif
VARIANT ?= OPTIMIZE
ifeq ($(VARIANT),DEBUG)
else ifeq ($(VARIANT),OPTIMIZE)
else
$(error Unrecognized build variant: $(VARIANT))
endif
include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/leaf.cfg
#
# Rules
#
COBJS_ = $(CSRCS:.c=.o)
COBJS = $(COBJS_:%=${ARCH}/%)
CXXOBJS_ = $(CXXSRCS:.cpp=.o)
CXXOBJS = $(CXXOBJS_:%=${ARCH}/%)
OBJS = $(COBJS) $(CXXOBJS)
# Copying directory structure to the output directory
$(info $(foreach var,$(dir $(CSRCS) $(CXXSRCS)),$(shell mkdir -vp "${ARCH}/$(var)")))
include $(LOCAL_DIR)/flashers/rules.mk
all: ${ARCH} $(PGM)
$(PGM): $(OBJS)
$(make-cxx-exe)