blob: cc121c5b935614fb623bfe532a959d3872f78f96 [file] [log] [blame]
Joey Armstrong78fca2d2024-05-01 16:51:58 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
3# Copyright 2022-2024 Open Networking Foundation Contributors
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# -----------------------------------------------------------------------
17# SPDX-FileCopyrightText: 2022-2024 Open Networking Foundation Contributors
18# SPDX-License-Identifier: Apache-2.0
19# -----------------------------------------------------------------------
20# Intent: This makefile will gather sources from the filesystem and
21# dynamically enable targets and functionality based on extension.
22# -----------------------------------------------------------------------
23
24$(if $(DEBUG),$(warning ENTER))
25
26##-------------------##
27##---] GLOBALS [---##
28##-------------------##
29
30##--------------------##
31##---] INCLUDES [---##
32##--------------------##
33
34# -----------------------------------------------------------------------
35# {shell,find} are expensive for every makefile invocation.
36# wildcard is intended for recursive make calls.
37# Define USE_xxx := 1 when sources are nested within subdirs
38# .* => also glob hidden directories
39# -----------------------------------------------------------------------
40_raw_ := $(wildcard * .* */*)
41_allfiles_ := $(filter-out %~,$(_raw_))
42_hiddenfiles_ := $(filter-out . ..,$(filter .%,$(_allfiles_)))
43
44# Enable functionality based on file detection
45$(call useEnable,GO)
46$(call useEnable,HTML)
47$(call useEnable,JAVA)
48$(call useEnable,PYTHON)
49$(call useEnable,RST)
50
51$(if $(DEBUG),$(warning LEAVE))
52
53# [EOF]