######################################################################
#                             SOURCES                                #
######################################################################

# Name of the project
PROJ_NAME    := wozmon

## FILES ##
SRCS         += vectors.asm
SRCS         += keyboard.asm
SRCS         += lcd.asm
SRCS         += wozmon.asm

## Directories ##
## This is where the source files are located,
## which are not in the current directory
SRC_DIR      := .

INC_DIR      := $(SRC_DIR)

BUILD_DIR    := build
OUTPUT_DIR   := output

######################################################################
#                          ARCHITECTURE                              #
######################################################################

LDSCRIPT = ../linker.cfg

######################################################################
#                        TOOLCHAIN FLAGS                             #
######################################################################

## Compiler flags ##
## Debug informations
# COMMON_CFLAGS      = -g -gdwarf-2
# ## Optimisation
# # COMMON_CFLAGS    += -Og
# COMMON_CFLAGS     += -Os
# ## All warning messages
# COMMON_CFLAGS     += -Wall -Wextra -Wshadow
# ## Use smallest size for enums
# COMMON_CFLAGS    += -fshort-enums
# ## Microcontroller informations
# COMMON_CFLAGS     += $(ARCH_FLAGS)
# ## Header files
# COMMON_CFLAGS     += $(addprefix -I,$(INC_DIR))

# ## gcc flags ##
# CFLAGS = $(COMMON_CFLAGS)
# ## Puts functions and data into its own section
# CFLAGS    += -ffunction-sections -fdata-sections

# ## g++ flags ##
# CXXFLAGS = $(COMMON_CFLAGS)
# CXXFLAGS += -std=c++11
# CXXFLAGS += -fno-exceptions -fstack-usage -fdump-tree-optimized -ffunction-sections -fdata-sections -fno-threadsafe-statics

## Linker flags ##
LDFLAGS    := -vm -m keyboardext.map
# LDFLAGS    += --specs=nano.specs -Wl,--gc-sections
# LDFLAGS    += -Wl,--no-wchar-size-warning
## Linker script
ifdef LDSCRIPT
LDFLAGS    += --config $(LDSCRIPT)
endif

include ../Makefile.rules.mk