Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 1 | # ifdtool - dump Intel Firmware Descriptor information |
| 2 | # |
Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 3 | # SPDX-License-Identifier: GPL-2.0-only |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 4 | |
| 5 | PROGRAM = ifdtool |
| 6 | |
Patrick Georgi | 3909908 | 2020-06-02 19:50:47 +0200 | [diff] [blame] | 7 | CC ?= gcc |
Yegor Timoshenko | c2e4941 | 2018-10-07 01:58:27 +0000 | [diff] [blame] | 8 | INSTALL = /usr/bin/env install |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 9 | PREFIX = /usr/local |
Mathew King | c7ddc99 | 2019-08-08 14:59:25 -0600 | [diff] [blame] | 10 | CFLAGS = -O2 -g -Wall -Wextra -Wmissing-prototypes -Werror |
Julius Werner | 98eeb96 | 2019-12-11 15:47:42 -0800 | [diff] [blame] | 11 | CFLAGS += -I../../src/commonlib/include -I../../src/commonlib/bsd/include |
Mathew King | c7ddc99 | 2019-08-08 14:59:25 -0600 | [diff] [blame] | 12 | CFLAGS += -I../cbfstool/flashmap |
Julius Werner | 98eeb96 | 2019-12-11 15:47:42 -0800 | [diff] [blame] | 13 | CFLAGS += -include ../../src/commonlib/bsd/include/commonlib/bsd/compiler.h |
Patrick Georgi | 472efa6 | 2012-02-16 20:44:20 +0100 | [diff] [blame] | 14 | LDFLAGS = |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 15 | |
| 16 | OBJS = ifdtool.o |
Mathew King | c7ddc99 | 2019-08-08 14:59:25 -0600 | [diff] [blame] | 17 | OBJS += fmap.o |
| 18 | OBJS += kv_pair.o |
| 19 | OBJS += valstr.o |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 20 | |
| 21 | all: dep $(PROGRAM) |
| 22 | |
| 23 | $(PROGRAM): $(OBJS) |
| 24 | $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS) |
| 25 | |
| 26 | clean: |
Werner Zeh | d5f91e4 | 2018-05-28 08:41:39 +0200 | [diff] [blame] | 27 | rm -f $(PROGRAM) *.o *~ .dependencies |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 28 | distclean: clean |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 29 | |
| 30 | dep: |
| 31 | @$(CC) $(CFLAGS) -MM *.c > .dependencies |
| 32 | |
Alexander Couzens | 746b6ab | 2016-09-10 18:36:16 +0200 | [diff] [blame] | 33 | %.o: %.c |
| 34 | $(CC) $(CFLAGS) -c -o $@ $< |
| 35 | |
Mathew King | c7ddc99 | 2019-08-08 14:59:25 -0600 | [diff] [blame] | 36 | %.o: ../cbfstool/flashmap/%.c |
| 37 | $(CC) $(CFLAGS) -c -o $@ $< |
| 38 | |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 39 | install: $(PROGRAM) |
| 40 | mkdir -p $(DESTDIR)$(PREFIX)/bin |
| 41 | $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/bin |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 42 | |
Patrick Georgi | 472efa6 | 2012-02-16 20:44:20 +0100 | [diff] [blame] | 43 | .PHONY: all clean distclean dep |