Evgeny Zinoviev | d54f825 | 2018-08-01 15:53:18 +0300 | [diff] [blame] | 1 | ## |
| 2 | ## Makefile for pmh7tool |
| 3 | ## |
| 4 | ## Copyright (C) 2018 Evgeny Zinoviev <me@ch1p.com> |
| 5 | ## |
| 6 | ## This program is free software; you can redistribute it and/or modify |
| 7 | ## it under the terms of the GNU General Public License as published by |
| 8 | ## the Free Software Foundation; version 2 of the License. |
| 9 | ## |
| 10 | ## This program is distributed in the hope that it will be useful, |
| 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | ## GNU General Public License for more details. |
| 14 | ## |
| 15 | |
| 16 | CC = gcc |
Jacob Garber | 52f0e84 | 2019-07-19 12:27:27 -0600 | [diff] [blame] | 17 | CFLAGS = -O2 -Wall -Wextra -Werror |
Evgeny Zinoviev | d54f825 | 2018-08-01 15:53:18 +0300 | [diff] [blame] | 18 | PROGRAM = pmh7tool |
Yegor Timoshenko | c2e4941 | 2018-10-07 01:58:27 +0000 | [diff] [blame] | 19 | INSTALL = /usr/bin/env install |
Evgeny Zinoviev | d54f825 | 2018-08-01 15:53:18 +0300 | [diff] [blame] | 20 | PREFIX = /usr/local |
| 21 | |
| 22 | all: $(PROGRAM) |
| 23 | |
| 24 | $(PROGRAM): pmh7tool.o |
| 25 | $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) |
| 26 | |
| 27 | install: $(PROGRAM) |
| 28 | $(INSTALL) $(PROGRAM) $(PREFIX)/sbin |
| 29 | |
| 30 | clean: |
| 31 | rm -f *.o $(PROGRAM) |
| 32 | |
| 33 | distclean: clean |
| 34 | |
| 35 | %.o: %.c |
| 36 | $(CC) $(CFLAGS) -c $^ -I. -o $@ |
| 37 | |
| 38 | .PHONY: all install clean distclean |