commit 931038deea228d041ecc83976e33c7dd87369e56
parent bf14a31c88299d66db5e833affe9fefda480aff4
Author: amrfti <andrew@kloet.net>
Date: Tue, 8 Jul 2025 23:16:51 -0400
update makefile
Diffstat:
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git 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