|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #
- # Snel makefile
- #
- # Author: Christos Choutouridis AEM:8997
- # email: cchoutou@ece.auth.gr
- #
-
- CXX := -c++
- CXXFLAGS := -std=c++14 -Wall -Wextra -Werror
- LDFLAGS := -lstdc++
- BUILD := ./bin
- OBJ_DIR := $(BUILD)/obj
- APP_DIR := $(BUILD)
- TARGET := snel
- SRC := $(wildcard src/*.cpp)
-
- OBJECTS := $(SRC:%.cpp=$(OBJ_DIR)/%.o)
-
- $(OBJ_DIR)/%.o: %.cpp
- @mkdir -p $(@D)
- $(CXX) $(CXXFLAGS) -o $@ -c $<
-
- $(APP_DIR)/$(TARGET): $(OBJECTS)
- @mkdir -p $(@D)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(APP_DIR)/$(TARGET) $(OBJECTS)
-
- # === Rules ===
- snel: build $(APP_DIR)/$(TARGET)
-
- build:
- @mkdir -p $(APP_DIR)
- @mkdir -p $(OBJ_DIR)
-
- debug: CXXFLAGS += -DDEBUG -g3
- debug: snel
-
- release: CXXFLAGS += -O2
- release: snel
-
- all: release
-
- clean:
- -@rm -rvf $(OBJ_DIR)/*
- -@rm -rvf $(APP_DIR)/*
-
- .PHONY: snel build debug release all clean
-
-
|