A quick and dirty shell implementation for A.U.TH. (Operating systems Lab)
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #
  2. # Snel makefile
  3. #
  4. # Author: Christos Choutouridis AEM:8997
  5. # email: cchoutou@ece.auth.gr
  6. #
  7. CXX := -c++
  8. CXXFLAGS := -std=c++14 -Wall -Wextra -Werror
  9. LDFLAGS := -lstdc++
  10. BUILD := ./bin
  11. OBJ_DIR := $(BUILD)/obj
  12. APP_DIR := $(BUILD)
  13. TARGET := snel
  14. SRC := $(wildcard src/*.cpp)
  15. OBJECTS := $(SRC:%.cpp=$(OBJ_DIR)/%.o)
  16. $(OBJ_DIR)/%.o: %.cpp
  17. @mkdir -p $(@D)
  18. $(CXX) $(CXXFLAGS) -o $@ -c $<
  19. $(APP_DIR)/$(TARGET): $(OBJECTS)
  20. @mkdir -p $(@D)
  21. $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(APP_DIR)/$(TARGET) $(OBJECTS)
  22. # === Rules ===
  23. snel: build $(APP_DIR)/$(TARGET)
  24. build:
  25. @mkdir -p $(APP_DIR)
  26. @mkdir -p $(OBJ_DIR)
  27. debug: CXXFLAGS += -DDEBUG -g3
  28. debug: snel
  29. release: CXXFLAGS += -O2
  30. release: snel
  31. all: release
  32. clean:
  33. -@rm -rvf $(OBJ_DIR)/*
  34. -@rm -rvf $(APP_DIR)/*
  35. .PHONY: snel build debug release all clean