Removed src base directory

This commit is contained in:
Mike Long
2011-01-01 20:13:33 +01:00
parent 64c57b015d
commit 71c66bfa3a
11 changed files with 28 additions and 25 deletions

View File

@@ -1,7 +1,8 @@
all: all:
cd src/test; make all mkdir -p build
cd src/examples; make all cd test; make all
cd examples; make all
clean: clean:
cd src/test; make clean cd test; make clean
cd src/examples; make clean cd examples; make clean

View File

@@ -1,22 +1,20 @@
$(VERBOSE).SILENT: $(VERBOSE).SILENT:
TEMPLATE_PROGNAME = ../../build/template BUILD_DIR = ../build
C_PROGNAME = ../../build/cmock TEMPLATE_PROGNAME = $(BUILD_DIR)/template
CPP_PROGNAME = ../../build/cppmock C_PROGNAME = $(BUILD_DIR)/cmock
CPP_PROGNAME = $(BUILD_DIR)/cppmock
CC = gcc CC = gcc
CC += -c CC += -c
CPP = g++ CPP = g++
CPP += -c CPP += -c
LD = g++ LD = g++
ODIR = ../../build C_OBJFILES = $(BUILD_DIR)/cmocktest.o $(BUILD_DIR)/embedded.o
TEMPLATE_OBJFILES = $(BUILD_DIR)/test_suite_template.o
C_OBJFILES = ../../build/cmocktest.o ../../build/embedded.o CPP_OBJFILES = $(BUILD_DIR)/cppmocktest.o $(BUILD_DIR)/embedded.o
TEMPLATE_OBJFILES = ../../build/test_suite_template.o
CPP_OBJFILES = ../../build/cppmocktest.o ../../build/embedded.o
CPP_LIBS = -lgtest -lpthread -lgtest_main CPP_LIBS = -lgtest -lpthread -lgtest_main
ODIR = ../../build
all: $(C_PROGNAME) $(CPP_PROGNAME) $(TEMPLATE_PROGNAME) all: $(C_PROGNAME) $(CPP_PROGNAME) $(TEMPLATE_PROGNAME)
@@ -24,24 +22,24 @@ all: $(C_PROGNAME) $(CPP_PROGNAME) $(TEMPLATE_PROGNAME)
clean: clean:
@echo "Cleaning object files" @echo "Cleaning object files"
@echo " rm -f ../../build/*.o" @echo " rm -f $(BUILD_DIR)/*.o"
rm -f ../../build/*.o rm -f $(BUILD_DIR)/*.o
@echo "Cleaning backups" @echo "Cleaning backups"
@echo " rm -f *~" @echo " rm -f *~"
rm -f *~ rm -f *~
@echo "Removing programs" @echo "Removing programs"
@echo " rm -f "$(C_PROGNAME) @echo " rm -f "$(C_PROGNAME)
rm -f $(C_PROGNAME) rm -f $(C_PROGNAME)
@echo " rm -f "$(CPP_PROGNAME) @echo " rm -f "$(CPP_PROGNAME) $(TEMPLATE_PROGNAME)
rm -f $(CPP_PROGNAME) rm -f $(CPP_PROGNAME) $(TEMPLATE_PROGNAME)
../../build/%.o: %.c $(BUILD_DIR)/%.o: %.c
@echo "Compiling "$@ @echo "Compiling "$@
@echo " CC "$< @echo " CC "$<
$(CC) -o $@ $< $(CC) -o $@ $<
../../build/%.o: %.cpp $(BUILD_DIR)/%.o: %.cpp
@echo "Compiling "$@ @echo "Compiling "$@
@echo " CPP "$< @echo " CPP "$<
$(CPP) -I/home/mlong/tools/gtest/gtest-1.5.0/include -o $@ $< $(CPP) -I/home/mlong/tools/gtest/gtest-1.5.0/include -o $@ $<

View File

View File

@@ -1,18 +1,22 @@
BUILD_DIR = ../build
CPP_SRCS += \ CPP_SRCS += \
fff_test.cpp fff_test.cpp
OBJS += \ OBJS += \
../../build/fff_test.o $(BUILD_DIR)/fff_test.o
LIBS := -lgtest_main -lgtest -lpthread LIBS := -lgtest_main -lgtest -lpthread
PROGNAME = $(BUILD_DIR)/fff_test
# All Target # All Target
all: ../../build/fff_test all: $(BUILD_DIR)/fff_test
# Each subdirectory must supply rules for building sources it contributes # Each subdirectory must supply rules for building sources it contributes
../../build/%.o: %.cpp $(BUILD_DIR)/%.o: %.cpp
@echo 'Building file: $<' @echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler' @echo 'Invoking: GCC C++ Compiler'
g++ -I/home/mlong/tools/gtest/gtest-1.5.0/include -O0 -g3 -Wall -c -o"$@" "$<" g++ -I/home/mlong/tools/gtest/gtest-1.5.0/include -O0 -g3 -Wall -c -o"$@" "$<"
@@ -21,15 +25,15 @@ all: ../../build/fff_test
# Tool invocations # Tool invocations
../../build/fff_test: $(OBJS) $(USER_OBJS) $(PROGNAME): $(OBJS) $(USER_OBJS)
@echo 'Building target: $@' @echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker' @echo 'Invoking: GCC C++ Linker'
g++ -L/home/mlong/tools/gtest -o"../../build/fff_test" $(OBJS) $(LIBS) g++ -L/home/mlong/tools/gtest -o"$(PROGNAME)" $(OBJS) $(LIBS)
@echo 'Finished building target: $@' @echo 'Finished building target: $@'
@echo ' ' @echo ' '
# Other Targets # Other Targets
clean: clean:
-$(RM) $(OBJS) fff_test -$(RM) $(OBJS) $(PROGNAME)
-@echo ' ' -@echo ' '