# Copyright 2017-2020 Authors of Cilium
# SPDX-License-Identifier: Apache-2.0
#
DEFAULT_OUT := connectivity-check.yaml
HOSTPORT_OUT := connectivity-check-hostport.yaml

SRC := $(wildcard *.yaml)
HOSTPORT_SRC := $(filter-out $(DEFAULT_OUT) $(HOSTPORT_OUT), $(SRC))
DEFAULT_SRC := $(filter-out $(wildcard *-hostport.yaml),$(HOSTPORT_SRC))


all: $(DEFAULT_OUT) $(HOSTPORT_OUT)

$(DEFAULT_OUT): $(DEFAULT_SRC)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $(DEFAULT_OUT)
	for FILE in $(DEFAULT_SRC); do \
		cat $$FILE >> $(DEFAULT_OUT); \
		echo "---" >> $(DEFAULT_OUT); \
	done

$(HOSTPORT_OUT): $(HOSTPORT_SRC)
	@echo '# Automatically generated by Makefile. DO NOT EDIT' > $(HOSTPORT_OUT)
	for FILE in $(HOSTPORT_SRC); do \
		cat $$FILE >> $(HOSTPORT_OUT); \
		echo "---" >> $(HOSTPORT_OUT); \
	done
