include ./config.mk

DEFINES := -Dradio_float_t=float -Dfir_float_t=float
CXXFLAGS_release := -O3 -flto
CFLAGS_release := -O3 -flto
LDFLAGS_release := -O3 -flto
TARGET_ARCH := -march=native
CXXFLAGS += -std=c++20
CXXFLAGS += -Wno-volatile
CXXFLAGS += -Wno-deprecated-declarations

PWD := $(realpath .)
CXX_SRCS += $(PWD)/main.cpp
CXX_SRCS += $(PWD)/test.cpp

LIBS := -lstdc++ -lm -lpthread -lrt 
LDFLAGS += $(TARGET_ARCH) $(LIBDIR)
DEFINES += -DPROCESSOR_BUFFER_USE_EXCEPTIONS
INCLUDES += -I $(LIBSRC_PATH) -I $(BLAZE_PATH)

all: compile app
app: packages link

.PHONY: Radio Fir Crc Wav

packages: Radio Fir Crc Wav
	
Radio:
	@$(MAKE) -C $(LIBSRC_PATH)/cpp/radio
Fir:
	@$(MAKE) -C $(LIBSRC_PATH)/fir
Crc:
	@$(MAKE) -C $(LIBSRC_PATH)/crc
Wav:
	@$(MAKE) -C $(LIBSRC_PATH)/wav

include $(MAKE_HOME)/compile.mk
include $(MAKE_HOME)/link.mk
