Skip to content

Commit

Permalink
Removed src base directory
Browse files Browse the repository at this point in the history
  • Loading branch information
meekrosoft committed Jan 1, 2011
1 parent 64c57b0 commit 71c66bf
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 25 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
all:
cd src/test; make all
cd src/examples; make all
mkdir -p build
cd test; make all
cd examples; make all

clean:
cd src/test; make clean
cd src/examples; make clean
cd test; make clean
cd examples; make clean
28 changes: 13 additions & 15 deletions src/examples/Makefile → examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
$(VERBOSE).SILENT:

TEMPLATE_PROGNAME = ../../build/template
C_PROGNAME = ../../build/cmock
CPP_PROGNAME = ../../build/cppmock
BUILD_DIR = ../build
TEMPLATE_PROGNAME = $(BUILD_DIR)/template
C_PROGNAME = $(BUILD_DIR)/cmock
CPP_PROGNAME = $(BUILD_DIR)/cppmock
CC = gcc
CC += -c
CPP = g++
CPP += -c
LD = g++

ODIR = ../../build

C_OBJFILES = ../../build/cmocktest.o ../../build/embedded.o
TEMPLATE_OBJFILES = ../../build/test_suite_template.o
CPP_OBJFILES = ../../build/cppmocktest.o ../../build/embedded.o
C_OBJFILES = $(BUILD_DIR)/cmocktest.o $(BUILD_DIR)/embedded.o
TEMPLATE_OBJFILES = $(BUILD_DIR)/test_suite_template.o
CPP_OBJFILES = $(BUILD_DIR)/cppmocktest.o $(BUILD_DIR)/embedded.o
CPP_LIBS = -lgtest -lpthread -lgtest_main

ODIR = ../../build

all: $(C_PROGNAME) $(CPP_PROGNAME) $(TEMPLATE_PROGNAME)

.PHONY: clean

clean:
@echo "Cleaning object files"
@echo " rm -f ../../build/*.o"
rm -f ../../build/*.o
@echo " rm -f $(BUILD_DIR)/*.o"
rm -f $(BUILD_DIR)/*.o
@echo "Cleaning backups"
@echo " rm -f *~"
rm -f *~
@echo "Removing programs"
@echo " rm -f "$(C_PROGNAME)
rm -f $(C_PROGNAME)
@echo " rm -f "$(CPP_PROGNAME)
rm -f $(CPP_PROGNAME)
@echo " rm -f "$(CPP_PROGNAME) $(TEMPLATE_PROGNAME)
rm -f $(CPP_PROGNAME) $(TEMPLATE_PROGNAME)


../../build/%.o: %.c
$(BUILD_DIR)/%.o: %.c
@echo "Compiling "$@
@echo " CC "$<
$(CC) -o $@ $<

../../build/%.o: %.cpp
$(BUILD_DIR)/%.o: %.cpp
@echo "Compiling "$@
@echo " CPP "$<
$(CPP) -I/home/mlong/tools/gtest/gtest-1.5.0/include -o $@ $<
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 10 additions & 6 deletions src/test/Makefile → test/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@

BUILD_DIR = ../build

CPP_SRCS += \
fff_test.cpp

OBJS += \
../../build/fff_test.o
$(BUILD_DIR)/fff_test.o

LIBS := -lgtest_main -lgtest -lpthread

PROGNAME = $(BUILD_DIR)/fff_test

# All Target
all: ../../build/fff_test
all: $(BUILD_DIR)/fff_test


# Each subdirectory must supply rules for building sources it contributes
../../build/%.o: %.cpp
$(BUILD_DIR)/%.o: %.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -I/home/mlong/tools/gtest/gtest-1.5.0/include -O0 -g3 -Wall -c -o"$@" "$<"
Expand All @@ -21,15 +25,15 @@ all: ../../build/fff_test


# Tool invocations
../../build/fff_test: $(OBJS) $(USER_OBJS)
$(PROGNAME): $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@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 ' '

# Other Targets
clean:
-$(RM) $(OBJS) fff_test
-$(RM) $(OBJS) $(PROGNAME)
-@echo ' '

File renamed without changes.

0 comments on commit 71c66bf

Please sign in to comment.