Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 1 | # |
| 2 | # ifdtool - dump Intel Firmware Descriptor information |
| 3 | # |
| 4 | # Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. |
| 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 | # |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 15 | |
| 16 | PROGRAM = ifdtool |
| 17 | |
| 18 | CC = gcc |
Yegor Timoshenko | c2e4941 | 2018-10-07 01:58:27 +0000 | [diff] [blame] | 19 | INSTALL = /usr/bin/env install |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 20 | PREFIX = /usr/local |
Mathew King | c7ddc99 | 2019-08-08 14:59:25 -0600 | [diff] [blame] | 21 | CFLAGS = -O2 -g -Wall -Wextra -Wmissing-prototypes -Werror |
| 22 | CFLAGS += -I../../src/commonlib/include |
| 23 | CFLAGS += -I../cbfstool/flashmap |
| 24 | CFLAGS += -include ../../src/commonlib/include/commonlib/compiler.h |
Patrick Georgi | 472efa6 | 2012-02-16 20:44:20 +0100 | [diff] [blame] | 25 | LDFLAGS = |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 26 | |
| 27 | OBJS = ifdtool.o |
Mathew King | c7ddc99 | 2019-08-08 14:59:25 -0600 | [diff] [blame] | 28 | OBJS += fmap.o |
| 29 | OBJS += kv_pair.o |
| 30 | OBJS += valstr.o |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 31 | |
| 32 | all: dep $(PROGRAM) |
| 33 | |
| 34 | $(PROGRAM): $(OBJS) |
| 35 | $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS) |
| 36 | |
| 37 | clean: |
Werner Zeh | d5f91e4 | 2018-05-28 08:41:39 +0200 | [diff] [blame] | 38 | rm -f $(PROGRAM) *.o *~ .dependencies |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 39 | distclean: clean |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 40 | |
| 41 | dep: |
| 42 | @$(CC) $(CFLAGS) -MM *.c > .dependencies |
| 43 | |
Alexander Couzens | 746b6ab | 2016-09-10 18:36:16 +0200 | [diff] [blame] | 44 | %.o: %.c |
| 45 | $(CC) $(CFLAGS) -c -o $@ $< |
| 46 | |
Mathew King | c7ddc99 | 2019-08-08 14:59:25 -0600 | [diff] [blame] | 47 | %.o: ../cbfstool/flashmap/%.c |
| 48 | $(CC) $(CFLAGS) -c -o $@ $< |
| 49 | |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 50 | install: $(PROGRAM) |
| 51 | mkdir -p $(DESTDIR)$(PREFIX)/bin |
| 52 | $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/bin |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 53 | |
Patrick Georgi | 472efa6 | 2012-02-16 20:44:20 +0100 | [diff] [blame] | 54 | .PHONY: all clean distclean dep |