Newer
Older
Birte Kristina Friesel
committed
# vim:ft=make
#
# Copyright 2020 Daniel Friesel
#
# SPDX-License-Identifier: BSD-2-Clause
Birte Kristina Friesel
committed
COMMON_FLAGS += -DMULTIPASS_ARCH_posix
COMMON_FLAGS += -DMULTIPASS_ARCH_HAS_I2C
Birte Kristina Friesel
committed
CC = gcc
CXX = g++
Birte Kristina Friesel
committed
CXX = ag++ -r build/repo.acp -v 0 -p . --Xcompiler
endif
CXX_TARGETS += src/arch/posix/arch.cc src/arch/posix/driver/gpio.cc
CXX_TARGETS += src/arch/posix/driver/stdout.cc
Birte Kristina Friesel
committed
ifneq ($(findstring counter,${arch_drivers}), )
CONFIG_arch_posix_driver_counter = y
endif
ifeq (${timer_s}, 1)
CONFIG_arch_posix_driver_uptime = y
ifdef CONFIG_arch_posix_driver_i2c
CXX_TARGETS += src/arch/posix/driver/i2c.cc
endif
CXX_TARGETS += src/arch/posix/driver/counter.cc
endif
ifdef CONFIG_arch_posix_driver_uptime
CXX_TARGETS += src/arch/posix/driver/uptime.cc
OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o}
Birte Kristina Friesel
committed
ifneq (${gpio_trace}, )
COMMON_FLAGS += -DGPIO_TRACE
endif
ifdef CONFIG_gpio_trace
COMMON_FLAGS += -DGPIO_TRACE
endif
%.o : %.cc | include/config.h
${QUIET}${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} -c -o $@ ${@:.o=.cc}
Birte Kristina Friesel
committed
%.o: %.c | include/config.h
${QUIET}${CC} ${INCLUDES} ${COMMON_FLAGS} ${CFLAGS} -c -o $@ ${@:.o=.c}
Birte Kristina Friesel
committed
build/system.elf: ${OBJECTS}
${QUIET}${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} \
Birte Kristina Friesel
committed
-o $@ ${OBJECTS}
run: build/system.elf
build/system.elf
program: build/system.elf
Birte Kristina Friesel
committed
arch_clean:
Birte Kristina Friesel
committed
arch_help:
@echo "posix specific flags:"
@echo " gpio_trace = 0 (show GPIO changes on stdout)"
@echo "Counter Overflow: 18446744073709551616/1"
@echo "Monitor: run build/system.elf"
attributes: build/system.elf
${QUIET}script/size.py size text data,bss
nfpvalues: build/system.elf
${QUIET}script/nfpvalues.py size text data,bss
.PHONY: arch_clean arch_help arch_info attributes monitor program run