aboutsummaryrefslogtreecommitdiff
path: root/vboot_firmware/Makefile
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 /vboot_firmware/Makefile
parent83c88cfa6920711b8a7823e1e3fc0efe8b71a04c (diff)
downloadvboot_reference-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 'vboot_firmware/Makefile')
-rw-r--r--vboot_firmware/Makefile32
1 files changed, 8 insertions, 24 deletions
diff --git a/vboot_firmware/Makefile b/vboot_firmware/Makefile
index efdb4db4..24404870 100644
--- a/vboot_firmware/Makefile
+++ b/vboot_firmware/Makefile
@@ -2,17 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-LIBNAME = vboot_fw.a
-
-CC ?= gcc
-CFLAGS = -Wall -DNDEBUG -O3 -Werror
-
FWTOP := $(shell pwd)
LIBDIR = $(FWTOP)/lib
STUBDIR = $(FWTOP)/stub
TESTDIR = $(FWTOP)/linktest
+BUILD_ROOT := ${BUILD}/$(shell basename ${FWTOP})
-INC = \
+INCLUDES = \
-I$(FWTOP)/include \
-I$(LIBDIR)/include \
-I$(LIBDIR)/cgptlib/include \
@@ -40,32 +36,20 @@ LIB_SRCS = \
./lib/vboot_firmware.c \
./lib/vboot_kernel.c
-LIB_OBJS = $(LIB_SRCS:%.c=%.o)
-
-# find ./stub -iname '*.c' | sort
STUB_SRCS = \
./stub/boot_device_stub.c \
./stub/load_firmware_stub.c \
./stub/tlcl.c \
./stub/utility_stub.c
-STUB_OBJS = $(STUB_SRCS:%.c=%.o)
+ALL_SRCS = ${LIB_SRCS} ${STUB_SRCS}
+test : $(FWLIB)
+ $(CC) $(CFLAGS) $(INCLUDES) -o $(BUILD_ROOT)/a.out \
+ $(TESTDIR)/main.c $(FWLIB)
-test : $(LIBNAME)
- $(CC) $(CFLAGS) $(INC) -o $(TESTDIR)/a.out $(TESTDIR)/main.c $(LIBNAME)
+include ../common.mk
-$(LIBNAME) : $(LIB_OBJS) $(STUB_OBJS)
+$(FWLIB) : $(ALL_OBJS)
rm -f $@
ar qc $@ $^
-
-%o : %c
- $(CC) $(CFLAGS) $(INC) -c -o $@ $<
-
-clean: FORCE
- rm -f $(LIBNAME) $(LIB_OBJS) $(STUB_OBJS) $(TESTDIR)/a.out
-
-FORCE:
-
-
-.PHONY: FORCE