Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Basic Makefile
- # by @angrykoala
- CXX = g++
- CPPFLAGS = -Wall -O1 -std=c++11 -g
- ASTYLE_FLAGS = --style=java --break-closing-brackets --align-pointer=name --delete-empty-lines --indent-col1-comments --unpad-paren -n -Q
- EXE = output_file
- BIN_DIR = bin
- INCLUDE_DIR = include
- SRC_DIR = src
- SRC = $(wildcard $(SRC_DIR)/*.cpp $(SRC_DIR)/*/*.cpp)
- INC = $(wildcard $(INCLUDE_DIR)/*.hpp $(INCLUDE_DIR)/*/*.hpp)
- main: $(BIN_DIR)/ $(BIN_DIR)/$(EXE)
- .PHONY: clean
- clean:
- rm -rf $(BIN_DIR)
- .PHONY: astyle
- astyle:
- astyle $(ASTYLE_FLAGS) $(SRC) $(INC)
- #print makefile variable (for makefile debug purposes)
- .PHONY: print-%
- print-% : ; @echo $* = $($*)
- $(BIN_DIR)/$(EXE): $(SRC)
- $(CXX) -o $@ $^ $(CPPFLAGS) -I $(INCLUDE_DIR)
- $(BIN_DIR)/:
- mkdir $(BIN_DIR)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement