diff --git a/Makefile b/Makefile index 4db96faeca..2a1043cf4b 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,10 @@ export TOP = $(shell pwd) export INCLUDES = \ -I$(TOP)/common/include \ -I$(TOP)/cryptolib/include \ - -I$(TOP)/misclibs/include + -I$(TOP)/misclibs/include \ + -I$(TOP)/cgptlib -SUBDIRS=common cryptolib misclibs vfirmware vkernel utility tests +SUBDIRS=common cgptlib cryptolib misclibs vfirmware vkernel utility tests all: for i in $(SUBDIRS); do \ diff --git a/cgptlib/Makefile b/cgptlib/Makefile index 418163c252..5ba386e714 100644 --- a/cgptlib/Makefile +++ b/cgptlib/Makefile @@ -2,8 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -CFLAGS ?= -Wall -Werror -ansi -INCLUDES += tests +CFLAGS += -Wall -Werror -ansi +INCLUDES += -Itests SUBDIRS = tests all: cgpt.a @@ -14,11 +14,11 @@ all: cgpt.a .c.o: $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ -cgpt.a: cgpt.o - $(AR) rs cgpt.a $< +cgpt.a: cgptlib.o quick_sort.o crc32.o + $(AR) rs $@ $^ clean: for i in $(SUBDIRS); do \ ( $(MAKE) -C $$i clean ) ; \ done - rm -f cgpt cgpt-host *.o *~ *.a + rm -f *.o *~ *.a diff --git a/cgptlib/cgpt.c b/cgptlib/cgptlib.c similarity index 99% rename from cgptlib/cgpt.c rename to cgptlib/cgptlib.c index d509f00c40..f2deb3fcdc 100644 --- a/cgptlib/cgpt.c +++ b/cgptlib/cgptlib.c @@ -3,9 +3,9 @@ * found in the LICENSE file. */ -#include "cgpt.h" +#include "cgptlib.h" #include -#include "cgpt_internal.h" +#include "cgptlib_internal.h" #include "crc32.h" #include "gpt.h" #include "quick_sort.h" diff --git a/cgptlib/cgpt.h b/cgptlib/cgptlib.h similarity index 97% rename from cgptlib/cgpt.h rename to cgptlib/cgptlib.h index 1f9f230515..ea352e7d2c 100644 --- a/cgptlib/cgpt.h +++ b/cgptlib/cgptlib.h @@ -3,8 +3,8 @@ * found in the LICENSE file. */ -#ifndef VBOOT_REFERENCE_CGPT_H_ -#define VBOOT_REFERENCE_CGPT_H_ +#ifndef VBOOT_REFERENCE_CGPTLIB_H_ +#define VBOOT_REFERENCE_CGPTLIB_H_ #include "gpt.h" #include @@ -133,4 +133,4 @@ int GptUpdateKernelEntry(GptData *gpt, uint32_t update_type); * GPT_ERROR_INVALID_UPDATE_TYPE, invalid 'update_type' is given. */ -#endif /* VBOOT_REFERENCE_CGPT_H_ */ +#endif /* VBOOT_REFERENCE_CGPTLIB_H_ */ diff --git a/cgptlib/cgpt_internal.h b/cgptlib/cgptlib_internal.h similarity index 94% rename from cgptlib/cgpt_internal.h rename to cgptlib/cgptlib_internal.h index c65f466b93..fe6f8296c8 100644 --- a/cgptlib/cgpt_internal.h +++ b/cgptlib/cgptlib_internal.h @@ -3,11 +3,11 @@ * found in the LICENSE file. */ -#ifndef VBOOT_REFERENCE_CGPT_INTERNAL_H_ -#define VBOOT_REFERENCE_CGPT_INTERNAL_H_ +#ifndef VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ +#define VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ #include -#include "cgpt.h" +#include "cgptlib.h" int CheckParameters(GptData *gpt); uint32_t CheckHeaderSignature(GptData *gpt); @@ -79,4 +79,4 @@ int GetSuccess(GptData *gpt, int secondary, int entry_index); #define CGPT_ATTRIBUTE_PRIORITY_MASK (CGPT_ATTRIBUTE_MAX_PRIORITY << \ CGPT_ATTRIBUTE_PRIORITY_OFFSET) -#endif /* VBOOT_REFERENCE_CGPT_INTERNAL_H_ */ +#endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ diff --git a/cgptlib/tests/Makefile b/cgptlib/tests/Makefile index 60871fa882..57b7bec363 100644 --- a/cgptlib/tests/Makefile +++ b/cgptlib/tests/Makefile @@ -2,11 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -CC ?= cc -CFLAGS ?= -Wall -DNDEBUG -Werror -ansi +CFLAGS += -Wall -DNDEBUG -Werror -ansi LIBS = ../cgpt.a ../../common/libcommon.a -OBJS = cgpt_test.o -OUT = cgpt_test +OBJS = cgptlib_test.o quick_sort_test.o +OUT = cgptlib_test all: $(OUT) diff --git a/cgptlib/tests/cgpt_test.c b/cgptlib/tests/cgptlib_test.c similarity index 99% rename from cgptlib/tests/cgpt_test.c rename to cgptlib/tests/cgptlib_test.c index 964232d6e6..b725749d91 100644 --- a/cgptlib/tests/cgpt_test.c +++ b/cgptlib/tests/cgptlib_test.c @@ -3,10 +3,10 @@ * found in the LICENSE file. */ -#include "cgpt_test.h" +#include "cgptlib_test.h" #include -#include "cgpt.h" -#include "cgpt_internal.h" +#include "cgptlib.h" +#include "cgptlib_internal.h" #include "crc32.h" #include "gpt.h" #include "quick_sort_test.h" diff --git a/cgptlib/tests/cgpt_test.h b/cgptlib/tests/cgptlib_test.h similarity index 85% rename from cgptlib/tests/cgpt_test.h rename to cgptlib/tests/cgptlib_test.h index 3a4191a8de..9812e77f38 100644 --- a/cgptlib/tests/cgpt_test.h +++ b/cgptlib/tests/cgptlib_test.h @@ -2,8 +2,8 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -#ifndef VBOOT_REFERENCE_CGPT_TEST_H_ -#define VBOOT_REFERENCE_CGPT_TEST_H_ +#ifndef VBOOT_REFERENCE_CGPTLIB_TEST_H_ +#define VBOOT_REFERENCE_CGPTLIB_TEST_H_ #include @@ -31,4 +31,4 @@ typedef int (*test_func)(void); } \ } while (0) -#endif /* VBOOT_REFERENCE_CGPT_TEST_H_ */ +#endif /* VBOOT_REFERENCE_CGPTLIB_TEST_H_ */ diff --git a/cgptlib/tests/quick_sort_test.c b/cgptlib/tests/quick_sort_test.c index 325c2fa83a..d63d08b72c 100644 --- a/cgptlib/tests/quick_sort_test.c +++ b/cgptlib/tests/quick_sort_test.c @@ -4,7 +4,7 @@ */ #include "quick_sort_test.h" -#include "cgpt_test.h" +#include "cgptlib_test.h" #include "quick_sort.h" #include "utility.h"