init: initial commit
This commit is contained in:
30
Makefile
Normal file
30
Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
SHELL = /bin/bash
|
||||
|
||||
SRC_DIR = ./src
|
||||
INC_DIR = ./include
|
||||
OBJ_DIR = ./obj
|
||||
|
||||
HEADERS = $(wildcard $(INC_DIR)/*.hpp)
|
||||
SRC_FILES = $(wildcard $(SRC_DIR)/*.cpp)
|
||||
OBJ_FILES = $(addprefix $(OBJ_DIR)/,$(notdir $(SRC_FILES:.cpp=.o)))
|
||||
|
||||
CXXFLAGS += -Wall -std=c++20 -O2
|
||||
|
||||
all: bin/swarm
|
||||
|
||||
$(OBJ_DIR)/%.o: src/%.cpp
|
||||
$(CXX) -I $(INC_DIR) $(CXXFLAGS) -c -o $@ $^
|
||||
|
||||
bin/swarm: $(OBJ_FILES)
|
||||
@mkdir -p $(OBJ_DIR)
|
||||
@mkdir -p bin
|
||||
$(CXX) -I $(INC_DIR) $(CXXFLAGS) -o $@ $^
|
||||
|
||||
.PHONY: debug
|
||||
debug: CXXFLAGS += -O0 -g
|
||||
debug: clean bin/swarm
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) obj/*.o
|
||||
$(RM) bin/swarm
|
Reference in New Issue
Block a user