blob: aa214f9b99d2300883dfd1d90ec794ebea0c5d69 [file] [log] [blame]
Tim Hall79d07d22020-04-27 18:20:16 +01001# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
2#
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the License); you may
6# not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# 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, WITHOUT
13# 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
18# Description:
19# Makefile to build mlw_codec
20
21UNAME=$(shell uname -o)
22
Michael McGeaghd5cf7652020-12-03 13:53:56 +000023CFLAGS=-Wall -Werror -Wno-unused-variable
24CFLAGS+=-fwrapv -fstack-protector-strong -flto -fuse-linker-plugin -ffat-lto-objects
Tim Hall79d07d22020-04-27 18:20:16 +010025
26ifeq ($(DEBUG),1)
27 CFLAGS+=-g -O0 -DDEBUG
28else
29 CFLAGS+=-O3
30endif
31
32LIBSRCS=mlw_encode.c mlw_decode.c
33LIBHDRS=mlw_encode.h mlw_decode.h mlw_common.h
34
35ifeq ($(UNAME),Cygwin)
36 MLWEXE=mlw_codec.exe
37else
38 MLWEXE=mlw_codec
39endif
40
41all: mlwexe
42
43.PHONY: mlwexe
44mlwexe: $(MLWEXE)
45
46clean:
47 rm -f $(MLWEXE)
48
49$(MLWEXE): mlw_main.c $(LIBSRCS) $(LIBHDRS) makefile
50 gcc $(CFLAGS) mlw_main.c $(LIBSRCS) -o $(MLWEXE) -lm