diff --git a/Makefile b/Makefile index 1577f75..7c32ed7 100644 --- a/Makefile +++ b/Makefile @@ -1,40 +1,33 @@ -# Compiler and flags -CXX = g++ +CXX = c++ CXXFLAGS = -Wall -Wextra -O3 LDFLAGS = -static -# Directories SRC_DIR = src OBJ_DIR = build BIN_DIR = bin -# File extensions SRC_EXT = cpp OBJ_EXT = o -# Find all source files and generate object files SOURCES = $(wildcard $(SRC_DIR)/*.$(SRC_EXT)) OBJECTS = $(SOURCES:$(SRC_DIR)/%.$(SRC_EXT)=$(OBJ_DIR)/%.$(OBJ_EXT)) -# Output executable EXEC = $(BIN_DIR)/fissh -# Default target: build everything all: $(EXEC) -# Rule to link the object files into the final executable $(EXEC): $(OBJECTS) @mkdir -p $(BIN_DIR) # Make sure the bin dir exists $(CXX) $(OBJECTS) -o $(EXEC) $(LDFLAGS) -# Rule to compile .cpp files into .o files $(OBJ_DIR)/%.o: $(SRC_DIR)/%.$(SRC_EXT) @mkdir -p $(OBJ_DIR) # Make sure the obj dir exists $(CXX) $(CXXFLAGS) -c $< -o $@ -# Clean up the build directory clean: rm -rf $(OBJ_DIR) $(BIN_DIR) -# Phony targets +install: $(EXEC) + install -m 755 $(EXEC) /usr/local/bin/ + .PHONY: all clean run