Makefile 1.3 KB

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