Martin Roth | adaab4a | 2022-10-28 22:38:44 -0600 | [diff] [blame^] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Daisuke Nojiri | a5ae62e | 2015-11-03 15:04:59 -0800 | [diff] [blame] | 2 | PROGRAM = archive |
Daisuke Nojiri | a1bb091 | 2015-11-17 13:25:39 -0800 | [diff] [blame] | 3 | HOSTCC ?= gcc |
Martin Roth | 264e14b | 2021-02-13 22:45:18 -0700 | [diff] [blame] | 4 | WERROR=-Werror |
| 5 | CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR} |
Daisuke Nojiri | a5ae62e | 2015-11-03 15:04:59 -0800 | [diff] [blame] | 6 | |
| 7 | SRCS = $(PROGRAM).c |
| 8 | |
| 9 | all: $(PROGRAM) |
| 10 | |
| 11 | $(PROGRAM): $(SRCS) |
Martin Roth | 264e14b | 2021-02-13 22:45:18 -0700 | [diff] [blame] | 12 | $(HOSTCC) $(CFLAGS) -o $@ $^ |
Daisuke Nojiri | a5ae62e | 2015-11-03 15:04:59 -0800 | [diff] [blame] | 13 | |
| 14 | clean: |
| 15 | rm -f $(PROGRAM) *.o |
| 16 | |
Martin Roth | 264e14b | 2021-02-13 22:45:18 -0700 | [diff] [blame] | 17 | distclean: clean |
| 18 | |
| 19 | help: |
| 20 | @echo "${PROGRAM}: Concatenate files and create an archive" |
| 21 | @echo "Targets: all, clean, distclean, help" |
| 22 | @echo "To disable warnings as errors, run make as:" |
| 23 | @echo " make all WERROR=\"\"" |
| 24 | |
| 25 | .PHONY: all clean distclean help |