Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Evgeny Zinoviev | d54f825 | 2018-08-01 15:53:18 +0300 | [diff] [blame] | 2 | |
| 3 | CC = gcc |
Jacob Garber | 52f0e84 | 2019-07-19 12:27:27 -0600 | [diff] [blame] | 4 | CFLAGS = -O2 -Wall -Wextra -Werror |
Evgeny Zinoviev | d54f825 | 2018-08-01 15:53:18 +0300 | [diff] [blame] | 5 | PROGRAM = pmh7tool |
Yegor Timoshenko | c2e4941 | 2018-10-07 01:58:27 +0000 | [diff] [blame] | 6 | INSTALL = /usr/bin/env install |
Evgeny Zinoviev | d54f825 | 2018-08-01 15:53:18 +0300 | [diff] [blame] | 7 | PREFIX = /usr/local |
| 8 | |
| 9 | all: $(PROGRAM) |
| 10 | |
| 11 | $(PROGRAM): pmh7tool.o |
| 12 | $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) |
| 13 | |
| 14 | install: $(PROGRAM) |
| 15 | $(INSTALL) $(PROGRAM) $(PREFIX)/sbin |
| 16 | |
| 17 | clean: |
| 18 | rm -f *.o $(PROGRAM) |
| 19 | |
| 20 | distclean: clean |
| 21 | |
| 22 | %.o: %.c |
| 23 | $(CC) $(CFLAGS) -c $^ -I. -o $@ |
| 24 | |
| 25 | .PHONY: all install clean distclean |