Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Makefile for Irrlicht Examples
  2. # It's usually sufficient to change just the target name and source file list
  3. # and be sure that CXX is set to a valid compiler
  4. # Name of the executable created (.exe will be added automatically if necessary)
  5. Target := 13.RenderToTexture
  6. # List of source files, separated by spaces
  7. Sources := main.cpp
  8. # Path to Irrlicht directory, should contain include/ and lib/
  9. IrrlichtHome := ../..
  10. # Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems
  11. BinPath = ../../bin/$(SYSTEM)
  12. # general compiler settings (might need to be set when compiling the lib, too)
  13. CPPFLAGS += -I$(IrrlichtHome)/include
  14. ifndef NDEBUG
  15. CXXFLAGS += -g -Wall
  16. else
  17. CXXFLAGS += -O3
  18. endif
  19. #default target is Linux
  20. all: all_linux
  21. # target specific settings
  22. all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
  23. all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor
  24. all_linux clean_linux: SYSTEM=Linux
  25. all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
  26. all_win32 clean_win32 static_win32: SUF=.exe
  27. static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
  28. all_win32: LDFLAGS += -lopengl32 -lm
  29. static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32
  30. # name of the binary - only valid for targets which set SYSTEM
  31. DESTPATH = $(BinPath)/$(Target)$(SUF)
  32. all_linux all_win32 static_win32:
  33. $(warning Building...)
  34. $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
  35. clean: clean_linux clean_win32
  36. $(warning Cleaning...)
  37. clean_linux clean_win32:
  38. @$(RM) $(DESTPATH)
  39. .PHONY: all all_win32 static_win32 clean clean_linux clean_win32
  40. #multilib handling
  41. ifeq ($(HOSTTYPE), x86_64)
  42. LIBSELECT=64
  43. endif
  44. #solaris real-time features
  45. ifeq ($(HOSTTYPE), sun4)
  46. LDFLAGS += -lrt
  47. endif