summaryrefslogtreecommitdiff
path: root/cgpt
diff options
context:
space:
mode:
authorvbendeb <vbendeb@chromium.org>2010-06-14 15:41:27 -0700
committervbendeb <vbendeb@chromium.org>2010-06-14 15:41:27 -0700
commit70e9509a2748c0ee8646d77f2a0e6fcbb1446505 (patch)
tree3557b5823bc2200dea45d399f72af51d7cde69f8 /cgpt
parent83c88cfa6920711b8a7823e1e3fc0efe8b71a04c (diff)
downloadvboot-70e9509a2748c0ee8646d77f2a0e6fcbb1446505.tar.gz
Rework the vboot_reference make system.
After this change the generated files are placed in a separate tree (such thet they don't show in the `git status' output anymore) and the dependencies are followed properly (if a .h file changes the appropriate .o files and apps get rebuilt). Tested as follows: > $ make clean > $ make # build succeeds > $ git status # shows clean directory > $ RUNTESTS=1 make # (captured test output matches that of the test run before any changes) > $ touch ./vboot_firmware/include/tlcl.h > $ make # make succeeds > $ find build -type f -newer ./vboot_firmware/include/tlcl.h build/vboot_firmware/lib/rollback_index.o build/vboot_firmware/lib/rollback_index.o.d build/vboot_firmware/a.out build/vboot_fw.a build/utility/vbutil_key build/utility/kernel_utility.d build/utility/vbutil_key.d build/utility/verify_data build/utility/load_kernel_test.d build/utility/vbutil_keyblock.d build/utility/vbutil_kernel build/utility/vbutil_kernel.d build/utility/firmware_utility build/utility/signature_digest_utility.d build/utility/kernel_utility build/utility/verify_data.d build/utility/vbutil_keyblock build/utility/signature_digest_utility build/utility/load_kernel_test build/utility/firmware_utility.d build/tests/vboot_common3_tests build/tests/vboot_common2_tests build/host/a.out $ > Review URL: http://codereview.chromium.org/2845001
Diffstat (limited to 'cgpt')
-rw-r--r--cgpt/Makefile38
1 files changed, 15 insertions, 23 deletions
diff --git a/cgpt/Makefile b/cgpt/Makefile
index 1f8deded..47856d5b 100644
--- a/cgpt/Makefile
+++ b/cgpt/Makefile
@@ -2,44 +2,36 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-CC ?= gcc
-TOP ?= ..
-CFLAGS ?= -Wall -DNDEBUG -O3 -Werror
CFLAGS += -static
LDFLAGS += -luuid
-FWDIR=$(TOP)/vboot_firmware
+BUILD_ROOT := ${BUILD}/cgpt
INCLUDES = -I$(FWDIR)/lib/cgptlib/include
-LIBS = $(FWDIR)/vboot_fw.a
+LIBS = ${FWLIB}
DESTDIR ?= /usr/bin
-PROGNAME = cgpt
+PROGNAME = ${BUILD_ROOT}/cgpt
-OBJS= \
- cgpt.o \
- cmd_show.o \
- cmd_repair.o \
- cmd_create.o \
- cmd_add.o \
- cmd_boot.o \
- cgpt_common.o
+ALL_SRCS = \
+ cgpt.c \
+ cmd_show.c \
+ cmd_repair.c \
+ cmd_create.c \
+ cmd_add.c \
+ cmd_boot.c \
+ cgpt_common.c
+include ../common.mk
all: $(PROGNAME)
-$(PROGNAME): $(OBJS) $(LIBS)
+$(PROGNAME): $(ALL_OBJS) $(LIBS)
$(CC) -o $(PROGNAME) $(CFLAGS) $^ $(LDFLAGS)
-.c.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
-
-clean:
- rm -f $(PROGNAME) *.o *~
-
install: $(PROGNAME)
mkdir -p $(DESTDIR)
cp -f $^ $(DESTDIR)
- chmod a+rx $(patsubst %,$(DESTDIR)/%,$^)
+ chmod a+rx $(patsubst ${BUILD_ROOT}/%,$(DESTDIR)/%,$^)
-.PHONY: all clean install
+.PHONY: all install