Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #put makefile in main project directory
- SRC_FILES = $(wildcard ./src/*.cpp ./src/*.hpp)
- INC_DIRS = -I"./src" -I"$(HOME)/codes"
- LIB_FLAGS =
- LIB_DIRS =
- GCC_FLAGS= -Wall -O2
- #generate list of all dependencies of the project
- DEP_LIST1 = $(shell g++ -M $(SRC_FILES) $(INC_DIRS))
- #filter out the main.o: etc parts
- DEP_LIST2 = $(filter-out %.o:, $(DEP_LIST1))
- #filter out the \ newline character caused by taking bash output
- DEP_LIST3 = $(filter-out \, $(DEP_LIST2))
- #strip whitespace
- DEP_LIST = $(strip $(DEP_LIST3))
- #suppress some ctags kinds, turn on recursion
- # kinds options for C++:
- # c classes
- # d macro definitions
- # e enumerators (values inside an enumeration)
- # f function definitions
- # g enumeration names
- # l local variables [off]
- # m class, struct, and union members
- # n namespaces
- # p function prototypes [off]
- # s structure names
- # t typedefs
- # u union names
- # v variable definitions
- # x external and forward variable declarations [off]
- CTAGS_OPTIONS = --C++-kinds=-d --C++-kinds=-e --C++-kinds=-m \
- --C++-kinds=-u --C++-kinds=-v
- default: compile
- compile:
- g++ $(SRC_FILES) $(INC_DIRS) $(LIB_DIRS) $(GCC_FLAGS) -o ./bin/n.o $(LIB_FLAGS)
- taggen:
- @ctags $(CTAGS_OPTIONS) $(DEP_LIST)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement