Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. # Basic Makefile
  2. # by @angrykoala
  3.  
  4. CXX = g++
  5. CPPFLAGS = -Wall -O1 -std=c++11 -g
  6.  
  7. ASTYLE_FLAGS = --style=java --break-closing-brackets --align-pointer=name --delete-empty-lines --indent-col1-comments --unpad-paren -n -Q
  8.  
  9. EXE = output_file
  10.  
  11. BIN_DIR = bin
  12. INCLUDE_DIR = include
  13. SRC_DIR = src
  14.  
  15. SRC = $(wildcard $(SRC_DIR)/*.cpp $(SRC_DIR)/*/*.cpp)
  16. INC = $(wildcard $(INCLUDE_DIR)/*.hpp $(INCLUDE_DIR)/*/*.hpp)
  17.  
  18.  
  19. main: $(BIN_DIR)/ $(BIN_DIR)/$(EXE)
  20.  
  21.  
  22. .PHONY: clean
  23. clean:
  24. rm -rf $(BIN_DIR)
  25.  
  26. .PHONY: astyle
  27. astyle:
  28. astyle $(ASTYLE_FLAGS) $(SRC) $(INC)
  29.  
  30. #print makefile variable (for makefile debug purposes)
  31. .PHONY: print-%
  32. print-% : ; @echo $* = $($*)
  33.  
  34. $(BIN_DIR)/$(EXE): $(SRC)
  35. $(CXX) -o $@ $^ $(CPPFLAGS) -I $(INCLUDE_DIR)
  36.  
  37. $(BIN_DIR)/:
  38. mkdir $(BIN_DIR)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement