From 0476f0237baac48ef450c5042d584856e510be0c Mon Sep 17 00:00:00 2001 From: Mike Long Date: Tue, 22 May 2012 15:44:49 +0800 Subject: [PATCH] Build global fakes tests --- test/Makefile | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/test/Makefile b/test/Makefile index 1c41aa5..b5e9435 100644 --- a/test/Makefile +++ b/test/Makefile @@ -6,15 +6,20 @@ $(BUILD_DIR)/fff_test_cpp.o \ $(BUILD_DIR)/gtest-all.o \ $(BUILD_DIR)/gtest-main.o -C_OBJS += \ -$(BUILD_DIR)/fff_test_c.o +CTEST_OBJS = $(BUILD_DIR)/fff_test_c.o + +GLOBAL_C_OBJS += \ +$(BUILD_DIR)/global_fakes.o \ +$(BUILD_DIR)/fff_test_global_c.o LIBS := -lpthread CPPNAME = $(BUILD_DIR)/fff_test_cpp CNAME = $(BUILD_DIR)/fff_test_c +GLOBALCNAME = $(BUILD_DIR)/fff_test_glob_c + # All Target -all: $(CPPNAME) $(CNAME) +all: $(CPPNAME) $(CNAME) $(GLOBALCNAME) # Each subdirectory must supply rules for building sources it contributes @@ -27,7 +32,7 @@ $(BUILD_DIR)/%.o: %.cpp $(BUILD_DIR)/%.o: %.c @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' + @echo 'Invoking: GCC C Compiler' gcc -I../ -O0 -g3 -Wall -std=c99 -c -o"$@" "$<" @echo 'Finished building: $<' @echo ' ' @@ -41,15 +46,22 @@ $(CPPNAME): $(CPP_OBJS) @echo 'Finished building target: $@' @echo ' ' -$(CNAME): $(C_OBJS) +$(CNAME): $(CTEST_OBJS) + @echo 'Building target: $@' + @echo 'Invoking: GCC C Linker' + gcc -o "$(CNAME)" $(CTEST_OBJS) $(LIBS) + @echo 'Finished building target: $@' + @echo ' ' + +$(GLOBALCNAME): $(GLOBAL_C_OBJS) @echo 'Building target: $@' @echo 'Invoking: GCC C++ Linker' - g++ -o "$(CNAME)" $(C_OBJS) $(LIBS) + g++ -o "$(GLOBALCNAME)" $(GLOBAL_C_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' # Other Targets clean: - -$(RM) $(CPP_OBJS) $(C_OBJS) $(CPPNAME) $(CNAME) + -$(RM) $(CPP_OBJS) $(GLOBAL_C_OBJS) $(C_OBJS) $(CPPNAME) $(CNAME) $(GLOBALCNAME) -@echo ' '