Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.8 KiB

  1. # ---------------------------------------------------------------
  2. # SWIG Tcl/Tk Makefile
  3. #
  4. # This file can be used to build various Tcl extensions with SWIG.
  5. # By default this file is set up for dynamic loading, but it can
  6. # be easily customized for static extensions by modifying various
  7. # portions of the file.
  8. #
  9. # SRCS = C source files
  10. # CXXSRCS = C++ source files
  11. # OBJCSRCS = Objective-C source files
  12. # OBJS = Additional .o files (compiled previously)
  13. # INTERFACE = SWIG interface file
  14. # TARGET = Name of target module or executable
  15. #
  16. # Many portions of this file were created by the SWIG configure
  17. # script and should already reflect your machine. However, you
  18. # may need to modify the Makefile to reflect your specific
  19. # application.
  20. #----------------------------------------------------------------
  21. SRCS =
  22. CXXSRCS =
  23. OBJCSRCS =
  24. OBJS =
  25. INTERFACE =
  26. WRAPFILE = $(INTERFACE:.i=_wrap.c)
  27. WRAPOBJ = $(INTERFACE:.i=_wrap.o)
  28. TARGET = module@SO@ # Use this kind of target for dynamic loading
  29. #TARGET = my_tclsh # Use this target for static linking
  30. prefix = @prefix@
  31. exec_prefix = @exec_prefix@
  32. CC = @CC@
  33. CXX = @CXX@
  34. OBJC = @CC@ -Wno-import # -Wno-import needed for gcc
  35. CFLAGS =
  36. INCLUDES =
  37. LIBS =
  38. # SWIG Options
  39. # SWIG = location of the SWIG executable
  40. # SWIGOPT = SWIG compiler options
  41. # SWIGCC = Compiler used to compile the wrapper file
  42. SWIG = $(exec_prefix)/bin/swig
  43. SWIGOPT = -tcl # use -tcl8 for Tcl 8.0
  44. SWIGCC = $(CC)
  45. # SWIG Library files. Uncomment one of these for rebuilding tclsh or wish
  46. #SWIGLIB = -ltclsh.i
  47. #SWIGLIB = -lwish.i
  48. # Rules for creating .o files from source.
  49. COBJS = $(SRCS:.c=.o)
  50. CXXOBJS = $(CXXSRCS:.cxx=.o)
  51. OBJCOBJS = $(OBJCSRCS:.m=.o)
  52. ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
  53. # Command that will be used to build the final extension.
  54. BUILD = $(SWIGCC)
  55. # Uncomment the following if you are using dynamic loading
  56. CCSHARED = @CCSHARED@
  57. BUILD = @LDSHARED@
  58. # Uncomment the following if you are using dynamic loading with C++ and
  59. # need to provide additional link libraries (this is not always required).
  60. #DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
  61. -L/usr/local/lib -lg++ -lstdc++ -lgcc
  62. # X11 installation (needed to rebuild Tk extensions)
  63. XLIB = @XLIBSW@
  64. XINCLUDE = @XINCLUDES@
  65. # Tcl installation (where is Tcl/Tk located)
  66. TCL_INCLUDE = @TCLINCLUDE@
  67. TCL_LIB = @TCLLIB@
  68. # Build libraries (needed for static builds)
  69. LIBM = @LIBM@
  70. LIBC = @LIBC@
  71. SYSLIBS = $(LIBM) $(LIBC) @LIBS@
  72. # Build options (uncomment only one these)
  73. BUILD_LIBS = $(LIBS) # Dynamic loading
  74. #BUILD_LIBS = $(TCL_LIB) -ltcl $(LIBS) $(SYSLIBS) # tclsh
  75. #BUILD_LIBS = $(TCL_LIB) -ltk -ltcl $(XLIB) $(LIBS) $(SYSLIBS) # wish
  76. # Compilation rules for non-SWIG components
  77. .SUFFIXES: .c .cxx .m
  78. .c.o:
  79. $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $<
  80. .cxx.o:
  81. $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $<
  82. .m.o:
  83. $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $<
  84. # ----------------------------------------------------------------------
  85. # Rules for building the extension
  86. # ----------------------------------------------------------------------
  87. all: $(TARGET)
  88. # Convert the wrapper file into an object file
  89. $(WRAPOBJ) : $(WRAPFILE)
  90. $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(TCL_INCLUDE)
  91. $(WRAPFILE) : $(INTERFACE)
  92. $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE)
  93. $(TARGET): $(WRAPOBJ) $(ALLOBJS)
  94. $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET)
  95. clean:
  96. rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET)