###############################################################################
#Copyright (C) 2024-2025 CIX Technology, Inc.
#All Rights Reserved.
#
#The code contained herein is licensed under the GNU General Public
#License. You may obtain a copy of the GNU General Public License
#Version 2 or later at the following locations:
#
#http://www.opensource.org/licenses/gpl-license.html
#http://www.gnu.org/copyleft/gpl.html
###############################################################################
#
#    @file   Makefile
#
#    @brief  configuration file to compile the tools
#
###############################################################################

SUBDIRS =
SCRIPTS = $(wildcard *.sh) $(wildcard *.py)
PROGS = wait_ap_buffer
CFLAGS += -Wall

all: $(PROGS)
	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done

$(PROGS): %: %.c
	$(CC) $(CFLAGS) -o $@ $<

install: all
	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done
	-ln -f $(SCRIPTS) ../../../bin/
	-ln -f $(PROGS) ../../../bin/

clean:
	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done
	rm -f $(PROGS)
