Advertisement
PaulGalindoIsart

SDL2_mixer Makefile

Oct 25th, 2019
965
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.58 KB | None | 0 0
  1. # Disable implicit rules and variables
  2. MAKEFLAGS+=--no-builtin-rules --no-builtin-variables
  3.  
  4. # CXX?=g++ means that it will use g++ if the variable is not already defined
  5. CXX?=g++
  6. CXXFLAGS=-Wall -Wextra -O0 -g -MMD
  7. # Don't forget to add mingw32 and SDL2main when building for window
  8. LDLIBS=-lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer
  9.  
  10. SRCS=main.cpp
  11. OBJS=$(SRCS:.cpp=.o)
  12. DEPS=$(SRCS:.cpp=.d)
  13.  
  14. .PHONY: all clean
  15.  
  16. all: main
  17.  
  18. -include $(DEPS)
  19.  
  20. main: $(OBJS)
  21.     $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS)
  22.  
  23. %.o: %.cpp
  24.     $(CXX) -o $@ -c $< $(CFLAGS)
  25.  
  26. clean:
  27.     rm -f main $(OBJS) $(DEPS)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement