1# Copyright (c) 2023-2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13ifeq ($(findstring ;, $(PATH)), ;)
14	export PWD:=$(shell cd)
15	export TARGET_DIR := $(PWD)
16	export BUILD_DIR:=$(TARGET_DIR)\build
17	export TARGET:=$(TARGET_DIR)\idl-gen.exe
18else
19	export PWD := $(abspath $(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
20	export TARGET_DIR := $(PWD)
21	export BUILD_DIR = $(TARGET_DIR)/build
22	export TARGET:=$(TARGET_DIR)/idl-gen
23endif
24
25export CXXFLAGS = -std=c++14 -O2 -Wall -fno-common -fno-strict-aliasing -s
26export Q := @
27export MAKEFLAGS += --no-print-directory
28
29MAKE_FILE_NAME = MakefileLinux
30ifeq ($(findstring ;, $(PATH)), ;)
31	MAKE_FILE_NAME := MakefileWin
32endif
33
34all:
35	$(Q) echo start build $(TARGET) ...
36	$(Q) $(MAKE) -f $(MAKE_FILE_NAME)
37
38clean:
39	$(Q) $(MAKE) -f $(MAKE_FILE_NAME) clean
40
41.PHONY: clean