A4/Makefile

68 lines
1.3 KiB
Makefile
Raw Normal View History

2024-11-06 16:59:37 -07:00
# THE NAME OF YOUR EXECUTABLE
TARGET = A4
# ALL CPP COMPILABLE IMPLEMENTATION FILES THAT MAKE UP THE PROJECT
SRC_FILES = main.cpp Bubble.cpp
# NO EDITS NEEDED BELOW THIS LINE
CXX = g++
CXXFLAGS = -O2
CXXFLAGS_DEBUG = -g
CXXFLAGS_WARN = -Wall -Wextra -Wunreachable-code -Wshadow -Wpedantic
CPPVERSION = -std=c++17
OBJECTS = $(SRC_FILES:.cpp=.o)
ifeq ($(OS),Windows_NT)
TARGET := $(TARGET).exe
DEL = del
Q =
INC_PATH = Z:/CSCI200/include/
LIB_PATH = Z:/CSCI200/lib/
RPATH =
else
DEL = rm -f
Q = "
INC_PATH = /usr/local/include/
LIB_PATH = /usr/local/lib/
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CXXFLAGS += -D LINUX
RPATH =
endif
ifeq ($(UNAME_S),Darwin)
CXXFLAGS += -D OSX
RPATH = -Wl,-rpath,/Library/Frameworks
endif
UNAME_P := $(shell uname -p)
endif
LIBS = -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lsfml-network
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CXX) -o $@ $^ $(RPATH) -L$(LIB_PATH) $(LIBS)
.cpp.o:
$(CXX) $(CXXFLAGS) $(CPPVERSION) $(CXXFLAGS_DEBUG) $(CXXFLAGS_WARN) -o $@ -c $< -I$(INC_PATH)
clean:
$(DEL) $(TARGET) $(OBJECTS)
depend:
@sed -i.bak '/^# DEPENDENCIES/,$$d' Makefile
@$(DEL) sed*
@echo $(Q)# DEPENDENCIES$(Q) >> Makefile
@$(CXX) -MM $(SRC_FILES) >> Makefile
.PHONY: all clean depend
# DEPENDENCIES
main.o: main.cpp