Makefile 1.27 KB
Newer Older
Aaron's avatar
Aaron committed
1
2
3
4
5
6
7
8
UTILITIES_DIR = ../utils/
OBJ_DIR = ../../obj/
BIN_DIR = ../../bin/


# -------------------
# define our includes
# -------------------
Aaron's avatar
Aaron committed
9
INCLUDES = -I$(UTILITIES_DIR)/tabFile/ -I$(UTILITIES_DIR)/lineFileUtilities/ -I$(UTILITIES_DIR)/version/ -I$(UTILITIES_DIR)/gzstream/ -I$(UTILITIES_DIR)/fileType/
Aaron's avatar
Aaron committed
10
11
12
13
14
15

# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= groupBy.cpp
OBJECTS= $(SOURCES:.cpp=.o)
16
_EXT_OBJECTS=tabFile.o lineFileUtilities.o gzstream.o fileType.o
Aaron's avatar
Aaron committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= groupBy


all: $(PROGRAM)

.PHONY: all


$(PROGRAM): $(BUILT_OBJECTS) $(EXT_OBJECTS)
	@echo "  * linking $(PROGRAM)"
	@$(CXX) $(LDFLAGS) $(CXXFLAGS) -o $(BIN_DIR)/$@ $^ $(LIBS)

$(BUILT_OBJECTS): $(SOURCES)
	@echo "  * compiling" $(*F).cpp
	@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)

$(EXT_OBJECTS):
Aaron's avatar
Aaron committed
36
	@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/tabFile/
Aaron's avatar
Aaron committed
37
38
	@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
	@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
39
	@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/	
Aaron's avatar
Aaron committed
40
41
42
43
44
45
46
47
	

	
clean:
	@echo "Cleaning up."
	@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*

.PHONY: clean