#======================================================================== # makefile # #======================================================================== # Source files. SRC_DIR = ../SourceCode # C and C++ compilers. CPP = g++ CC = gcc # Turn on exceptions. # Turn on debugging. CFLAGS = -fexceptions -g3 # Libraries and include files. LIBS = -L"C:/cygwin/lib" INC = -I"C:/cygwin/lib/gcc/i686-pc-mingw32/3.4.4/include/c++" # Object files. OBJ_DIR = Bin OBJ = $(OBJ_DIR)/testCRC.o $(OBJ_DIR)/shiftRegister.o $(OBJ_DIR)/crcCode.o # Executables. BIN_DIR = Bin BIN = $(BIN_DIR)/testCRC.exe # Make executable and run a test. all: $(BIN) $(BIN) # Remove all object files and binaries. clean: rm $(OBJ) $(BIN) # Link all object files to executable. $(BIN): $(OBJ) $(CPP) $(OBJ) -o $(BIN) $(LIBS) # Separate compilation of source files. $(BIN_DIR)/testCRC.o: $(SRC_DIR)/testCRC.cpp $(CPP) -c $(CFLAGS) $(INC) $(SRC_DIR)/testCRC.cpp -o $(OBJ_DIR)/testCRC.o $(BIN_DIR)/shiftRegister.o: $(SRC_DIR)/shiftRegister.cpp $(CPP) -c $(CFLAGS) $(INC) $(SRC_DIR)/shiftRegister.cpp -o $(OBJ_DIR)/shiftRegister.o $(BIN_DIR)/crcCode.o: $(SRC_DIR)/crcCode.cpp $(CPP) -c $(CFLAGS) $(INC) $(SRC_DIR)/crcCode.cpp -o $(OBJ_DIR)/crcCode.o