Rickard Bolin | bc6ee58 | 2022-11-04 08:24:29 +0000 | [diff] [blame^] | 1 | # SPDX-FileCopyrightText: Copyright 2020 Arm Limited and/or its affiliates <open-source-office@arm.com> |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 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. |
Rickard Bolin | bc6ee58 | 2022-11-04 08:24:29 +0000 | [diff] [blame^] | 16 | # |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 17 | # Description: |
| 18 | # Makefile to build mlw_codec |
| 19 | |
| 20 | UNAME=$(shell uname -o) |
| 21 | |
Michael McGeagh | d5cf765 | 2020-12-03 13:53:56 +0000 | [diff] [blame] | 22 | CFLAGS=-Wall -Werror -Wno-unused-variable |
| 23 | CFLAGS+=-fwrapv -fstack-protector-strong -flto -fuse-linker-plugin -ffat-lto-objects |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 24 | |
| 25 | ifeq ($(DEBUG),1) |
| 26 | CFLAGS+=-g -O0 -DDEBUG |
| 27 | else |
| 28 | CFLAGS+=-O3 |
| 29 | endif |
| 30 | |
| 31 | LIBSRCS=mlw_encode.c mlw_decode.c |
| 32 | LIBHDRS=mlw_encode.h mlw_decode.h mlw_common.h |
| 33 | |
| 34 | ifeq ($(UNAME),Cygwin) |
| 35 | MLWEXE=mlw_codec.exe |
| 36 | else |
| 37 | MLWEXE=mlw_codec |
| 38 | endif |
| 39 | |
| 40 | all: mlwexe |
| 41 | |
| 42 | .PHONY: mlwexe |
| 43 | mlwexe: $(MLWEXE) |
| 44 | |
| 45 | clean: |
| 46 | rm -f $(MLWEXE) |
| 47 | |
| 48 | $(MLWEXE): mlw_main.c $(LIBSRCS) $(LIBHDRS) makefile |
| 49 | gcc $(CFLAGS) mlw_main.c $(LIBSRCS) -o $(MLWEXE) -lm |