forked from 3rd-party/fff
Added tests from C context
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
|
||||
BUILD_DIR = ../build
|
||||
|
||||
CPP_SRCS += \
|
||||
fff_test.cpp
|
||||
CPP_OBJS += \
|
||||
$(BUILD_DIR)/fff_test_cpp.o
|
||||
|
||||
OBJS += \
|
||||
$(BUILD_DIR)/fff_test.o
|
||||
C_OBJS += \
|
||||
$(BUILD_DIR)/fff_test_c.o
|
||||
|
||||
LIBS := -lgtest_main -lgtest -lpthread
|
||||
|
||||
PROGNAME = $(BUILD_DIR)/fff_test
|
||||
|
||||
CPPNAME = $(BUILD_DIR)/fff_test_cpp
|
||||
CNAME = $(BUILD_DIR)/fff_test_c
|
||||
# All Target
|
||||
all: $(BUILD_DIR)/fff_test
|
||||
all: $(CPPNAME) $(CNAME)
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
@@ -23,17 +23,31 @@ $(BUILD_DIR)/%.o: %.cpp
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: GCC C++ Compiler'
|
||||
gcc -I/home/mlong/tools/gtest/gtest-1.5.0/include -O0 -g3 -Wall -std=c99 -c -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
# Tool invocations
|
||||
$(PROGNAME): $(OBJS) $(USER_OBJS)
|
||||
$(CPPNAME): $(CPP_OBJS)
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking: GCC C++ Linker'
|
||||
g++ -L/home/mlong/tools/gtest -o"$(PROGNAME)" $(OBJS) $(LIBS)
|
||||
g++ -L/home/mlong/tools/gtest -o"$(CPPNAME)" $(CPP_OBJS) $(LIBS)
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
$(CNAME): $(C_OBJS)
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking: GCC C++ Linker'
|
||||
g++ -L/home/mlong/tools/gtest -o"$(CNAME)" $(C_OBJS) $(LIBS)
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
# Other Targets
|
||||
clean:
|
||||
-$(RM) $(OBJS) $(PROGNAME)
|
||||
-$(RM) $(CPP_OBJS) $(C_OBJS) $(CPPNAME) $(CNAME)
|
||||
-@echo ' '
|
||||
|
||||
|
||||
Reference in New Issue
Block a user