first commit
This commit is contained in:
36
sort_closet/code-sorting/Makefile
Normal file
36
sort_closet/code-sorting/Makefile
Normal file
@@ -0,0 +1,36 @@
|
||||
# Compiler and flags
|
||||
CXX := g++
|
||||
CXXFLAGS := -std=c++11 -Wall -O2
|
||||
|
||||
# Executable name
|
||||
TARGET := sorting_experiment
|
||||
|
||||
# Source files
|
||||
# Automatically find all .cpp files in the current directory
|
||||
SRCS := $(wildcard *.cpp)
|
||||
|
||||
# Object files
|
||||
# Replace .cpp extension with .o
|
||||
OBJS := $(SRCS:.cpp=.o)
|
||||
|
||||
# Default target
|
||||
all: $(TARGET)
|
||||
|
||||
# Link the program
|
||||
$(TARGET): $(OBJS)
|
||||
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS)
|
||||
|
||||
# Compile source files into object files
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
# Target to run the experiment
|
||||
run: all
|
||||
@./$(TARGET)
|
||||
|
||||
# Clean up build files
|
||||
clean:
|
||||
rm -f $(TARGET) $(OBJS)
|
||||
|
||||
# Phony targets
|
||||
.PHONY: all clean run
|
||||
Reference in New Issue
Block a user