Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 := 09.Meshviewer
  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: LDFLAGS += `sdl-config --libs`
  25. all_linux clean_linux: SYSTEM=Linux
  26. all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
  27. all_win32 clean_win32 static_win32: SUF=.exe
  28. static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
  29. all_win32: LDFLAGS += -lopengl32 -lm
  30. static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32
  31. # name of the binary - only valid for targets which set SYSTEM
  32. DESTPATH = $(BinPath)/$(Target)$(SUF)
  33. all_linux all_win32 static_win32:
  34. $(warning Building...)
  35. $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
  36. clean: clean_linux clean_win32
  37. $(warning Cleaning...)
  38. clean_linux clean_win32:
  39. @$(RM) $(DESTPATH)
  40. .PHONY: all all_win32 static_win32 clean clean_linux clean_win32
  41. #multilib handling
  42. ifeq ($(HOSTTYPE), x86_64)
  43. LIBSELECT=64
  44. endif
  45. #solaris real-time features
  46. ifeq ($(HOSTTYPE), sun4)
  47. LDFLAGS += -lrt
  48. endif