blob: a4f0af62175be93be46e2428b60b7b2127d52885 [file] [log] [blame]
Stefan Reinauer1c795ad12011-10-14 12:49:41 -07001#
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 Reinauer1c795ad12011-10-14 12:49:41 -070015
16PROGRAM = ifdtool
17
18CC = gcc
Yegor Timoshenkoc2e49412018-10-07 01:58:27 +000019INSTALL = /usr/bin/env install
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070020PREFIX = /usr/local
Mathew Kingc7ddc992019-08-08 14:59:25 -060021CFLAGS = -O2 -g -Wall -Wextra -Wmissing-prototypes -Werror
22CFLAGS += -I../../src/commonlib/include
23CFLAGS += -I../cbfstool/flashmap
24CFLAGS += -include ../../src/commonlib/include/commonlib/compiler.h
Patrick Georgi472efa62012-02-16 20:44:20 +010025LDFLAGS =
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070026
27OBJS = ifdtool.o
Mathew Kingc7ddc992019-08-08 14:59:25 -060028OBJS += fmap.o
29OBJS += kv_pair.o
30OBJS += valstr.o
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070031
32all: dep $(PROGRAM)
33
34$(PROGRAM): $(OBJS)
35 $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
36
37clean:
Werner Zehd5f91e42018-05-28 08:41:39 +020038 rm -f $(PROGRAM) *.o *~ .dependencies
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070039distclean: clean
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070040
41dep:
42 @$(CC) $(CFLAGS) -MM *.c > .dependencies
43
Alexander Couzens746b6ab2016-09-10 18:36:16 +020044%.o: %.c
45 $(CC) $(CFLAGS) -c -o $@ $<
46
Mathew Kingc7ddc992019-08-08 14:59:25 -060047%.o: ../cbfstool/flashmap/%.c
48 $(CC) $(CFLAGS) -c -o $@ $<
49
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070050install: $(PROGRAM)
51 mkdir -p $(DESTDIR)$(PREFIX)/bin
52 $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/bin
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070053
Patrick Georgi472efa62012-02-16 20:44:20 +010054.PHONY: all clean distclean dep