Build global fakes tests

This commit is contained in:
Mike Long
2012-05-22 15:44:49 +08:00
parent 65da4e650c
commit 0476f0237b

View File

@@ -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 ' '