Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 := Demo
  6. # List of source files, separated by spaces
  7. Sources := CDemo.cpp CMainMenu.cpp 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. # if you enable sound add the proper library for linking
  20. #LDFLAGS += -lIrrKlang
  21. #LDFLAGS += -laudiere
  22. #LDFLAGS += -lSDL_mixer -lSDL
  23. #default target is Linux
  24. all: all_linux
  25. # target specific settings
  26. all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
  27. all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor
  28. all_linux clean_linux: SYSTEM=Linux
  29. all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
  30. all_win32 clean_win32 static_win32: SUF=.exe
  31. static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
  32. all_win32: LDFLAGS += -lopengl32 -lm
  33. static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32
  34. # name of the binary - only valid for targets which set SYSTEM
  35. DESTPATH = $(BinPath)/$(Target)$(SUF)
  36. all_linux all_win32 static_win32:
  37. $(warning Building...)
  38. $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
  39. clean: clean_linux clean_win32
  40. $(warning Cleaning...)
  41. clean_linux clean_win32:
  42. @$(RM) $(DESTPATH)
  43. .PHONY: all all_win32 static_win32 clean clean_linux clean_win32
  44. #multilib handling
  45. ifeq ($(HOSTTYPE), x86_64)
  46. LIBSELECT=64
  47. endif
  48. #solaris real-time features
  49. ifeq ($(HOSTTYPE), sun4)
  50. LDFLAGS += -lrt
  51. endif