# SPDX-License-Identifier: LGPL-2.1-only
#
# Makefile - global Makefile for all components
#
# Copyright (C) 2001-2025 PEAK System-Technik GmbH <www.peak-system.com>
#
# Contact:       <linux.peak@hms-networks.com>
# Maintainer:    Stephane Grosjean <stephane.grosjean@hms-networks.com>

define do-make
	@for d in `find . -mindepth 1 -maxdepth 1 -type d`; do \
		if [ -f $$d/Makefile ]; then \
			$(MAKE) -C $$d $1; \
			if [ $$? -ne 0 ]; then break; fi; \
		fi; \
	 done
endef

define make-all
$(call do-make, all)
endef

define make-clean
$(call do-make, clean)
endef

define make-install
$(call do-make, install)
endef

define make-uninstall
$(call do-make, uninstall)
endef

.PHONY: clean install uninstall

all:
	$(make-all)

clean:
	$(make-clean)

install:
	$(make-install)
 
uninstall:
	$(make-uninstall)

#
# helpers
#
-include private/Makefile.inc
