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