OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 CC ?= gcc | |
6 TOP ?= .. | |
7 CFLAGS ?= -Wall -DNDEBUG -O3 -Werror | |
8 CFLAGS += -static | 5 CFLAGS += -static |
9 LDFLAGS += -luuid | 6 LDFLAGS += -luuid |
10 FWDIR=$(TOP)/vboot_firmware | 7 BUILD_ROOT := ${BUILD}/cgpt |
11 | 8 |
12 INCLUDES = -I$(FWDIR)/lib/cgptlib/include | 9 INCLUDES = -I$(FWDIR)/lib/cgptlib/include |
13 LIBS = $(FWDIR)/vboot_fw.a | 10 LIBS = ${FWLIB} |
14 | 11 |
15 DESTDIR ?= /usr/bin | 12 DESTDIR ?= /usr/bin |
16 | 13 |
17 PROGNAME = cgpt | 14 PROGNAME = ${BUILD_ROOT}/cgpt |
18 | 15 |
19 OBJS= \ | 16 ALL_SRCS = \ |
20 » cgpt.o \ | 17 » cgpt.c \ |
21 » cmd_show.o \ | 18 » cmd_show.c \ |
22 » cmd_repair.o \ | 19 » cmd_repair.c \ |
23 » cmd_create.o \ | 20 » cmd_create.c \ |
24 » cmd_add.o \ | 21 » cmd_add.c \ |
25 » cmd_boot.o \ | 22 » cmd_boot.c \ |
26 » cgpt_common.o | 23 » cgpt_common.c |
27 | 24 |
| 25 include ../common.mk |
28 | 26 |
29 all: $(PROGNAME) | 27 all: $(PROGNAME) |
30 | 28 |
31 $(PROGNAME): $(OBJS) $(LIBS) | 29 $(PROGNAME): $(ALL_OBJS) $(LIBS) |
32 $(CC) -o $(PROGNAME) $(CFLAGS) $^ $(LDFLAGS) | 30 $(CC) -o $(PROGNAME) $(CFLAGS) $^ $(LDFLAGS) |
33 | 31 |
34 .c.o: | |
35 $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ | |
36 | |
37 clean: | |
38 rm -f $(PROGNAME) *.o *~ | |
39 | |
40 install: $(PROGNAME) | 32 install: $(PROGNAME) |
41 mkdir -p $(DESTDIR) | 33 mkdir -p $(DESTDIR) |
42 cp -f $^ $(DESTDIR) | 34 cp -f $^ $(DESTDIR) |
43 » chmod a+rx $(patsubst %,$(DESTDIR)/%,$^) | 35 » chmod a+rx $(patsubst ${BUILD_ROOT}/%,$(DESTDIR)/%,$^) |
44 | 36 |
45 .PHONY: all clean install | 37 .PHONY: all install |
OLD | NEW |