Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Irrlicht Engine Regression Tests Makefile
  2. Target = tests
  3. Sources = $(wildcard *.cpp)
  4. CPPFLAGS = -I../include -I/usr/X11R6/include -pipe
  5. # CXXFLAGS += -O3
  6. CXXFLAGS += -Wall -ansi -pedantic -O0 -g -D_DEBUG -fno-exceptions
  7. ifeq ($(HOSTTYPE), x86_64)
  8. LIBSELECT=64
  9. endif
  10. all: all_linux
  11. # target specific settings
  12. all_linux: SYSTEM=Linux
  13. all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor
  14. all_win32 clean_win32: SYSTEM=Win32-gcc
  15. all_win32: LDFLAGS = -L../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm
  16. all_win32 clean_win32: SUF=.exe
  17. # name of the binary - only valid for targets which set SYSTEM
  18. DESTPATH = ../bin/$(SYSTEM)/$(Target)$(SUF)
  19. OBJ = $(Sources:.cpp=.o)
  20. all_linux all_win32: $(OBJ)
  21. $(warning Building...)
  22. $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS)
  23. @$(RM) tests # otherwise it's easy to forget to copy it and run the old binary
  24. clean: clean_linux clean_win32
  25. $(warning Cleaning...)
  26. @$(RM) $(OBJ)
  27. clean_linux clean_win32:
  28. @$(RM) $(DESTPATH)
  29. .PHONY: all all_win32 clean clean_linux clean_win32
  30. # Create dependency files for automatic recompilation
  31. %.d:%.cpp
  32. $(CXX) $(CPPFLAGS) -MM -MF $@ $<
  33. ifneq ($(MAKECMDGOALS),clean)
  34. -include $(OBJ:.o=.d)
  35. endif