Last active
October 23, 2018 12:41
-
-
Save arsaccol/f178082e2056c2f1f07e24b723bcc1c1 to your computer and use it in GitHub Desktop.
Sample, generic-ish makefile with some SFML libraries being linked; pretty much copied this from some tutorial so I don't quite claim authorship. This makefile will generate one object file for every .cpp file without any regard for dependencies and then link them all together, so watch that you don't run an executable that was linked with outda…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = g++ | |
CFLAGS = -std=c++11 -Wextra | |
LDFLAGS= -lsfml-graphics -lsfml-window -lsfml-system | |
EXEC = executable | |
SOURCES = $(wildcard *.cpp) | |
OBJECTS = $(SOURCES:.cpp=.o) | |
$(EXEC): $(OBJECTS) | |
$(CC) $(OBJECTS) -o $(EXEC) $(LDFLAGS) | |
%.o: %.cpp | |
$(CC) -c $(CFLAGS) $< -o $@ | |
clean: | |
rm -f $(EXEC) $(OBJECTS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment