Makefile
上传用户:dlhongjiu
上传日期:2013-06-14
资源大小:1516k
文件大小:3k
源码类别:

信息检索与抽取

开发平台:

MultiPlatform

  1. #****************************************************************************
  2. #
  3. # Makefile for TinyXml test.
  4. # Lee Thomason
  5. # www.grinninglizard.com
  6. #
  7. # This is a GNU make (gmake) makefile
  8. #****************************************************************************
  9. # DEBUG can be set to YES to include debugging info, or NO otherwise
  10. DEBUG          := YES
  11. # PROFILE can be set to YES to include profiling info, or NO otherwise
  12. PROFILE        := NO
  13. # TINYXML_USE_STL can be used to turn on STL support. NO, then STL
  14. # will not be used. YES will include the STL files.
  15. TINYXML_USE_STL := NO
  16. #****************************************************************************
  17. CC     := gcc
  18. CXX    := g++
  19. LD     := g++
  20. AR     := ar rc
  21. RANLIB := ranlib
  22. DEBUG_CFLAGS     := -Wall -Wno-format -g -DDEBUG
  23. RELEASE_CFLAGS   := -Wall -Wno-unknown-pragmas -Wno-format -O3
  24. LIBS  :=
  25. DEBUG_CXXFLAGS   := ${DEBUG_CFLAGS} 
  26. RELEASE_CXXFLAGS := ${RELEASE_CFLAGS}
  27. DEBUG_LDFLAGS    := -g
  28. RELEASE_LDFLAGS  :=
  29. ifeq (YES, ${DEBUG})
  30.    CFLAGS       := ${DEBUG_CFLAGS}
  31.    CXXFLAGS     := ${DEBUG_CXXFLAGS}
  32.    LDFLAGS      := ${DEBUG_LDFLAGS}
  33. else
  34.    CFLAGS       := ${RELEASE_CFLAGS}
  35.    CXXFLAGS     := ${RELEASE_CXXFLAGS}
  36.    LDFLAGS      := ${RELEASE_LDFLAGS}
  37. endif
  38. ifeq (YES, ${PROFILE})
  39.    CFLAGS   := ${CFLAGS} -pg -O3
  40.    CXXFLAGS := ${CXXFLAGS} -pg -O3
  41.    LDFLAGS  := ${LDFLAGS} -pg
  42. endif
  43. #****************************************************************************
  44. # Preprocessor directives
  45. #****************************************************************************
  46. ifeq (YES, ${TINYXML_USE_STL})
  47.   DEFS := -DTIXML_USE_STL
  48. else
  49.   DEFS :=
  50. endif
  51. #****************************************************************************
  52. # Include paths
  53. #****************************************************************************
  54. #INCS := -I/usr/include/g++-2 -I/usr/local/include
  55. INCS :=
  56. #****************************************************************************
  57. # Makefile code common to all platforms
  58. #****************************************************************************
  59. CFLAGS   := ${CFLAGS}   ${DEFS}
  60. CXXFLAGS := ${CXXFLAGS} ${DEFS}
  61. #****************************************************************************
  62. # Targets of the build
  63. #****************************************************************************
  64. OUTPUT := xmltest
  65. all: ${OUTPUT}
  66. #****************************************************************************
  67. # Source files
  68. #****************************************************************************
  69. SRCS := tinyxml.cpp tinyxmlparser.cpp xmltest.cpp tinyxmlerror.cpp tinystr.cpp
  70. # Add on the sources for libraries
  71. SRCS := ${SRCS}
  72. OBJS := $(addsuffix .o,$(basename ${SRCS}))
  73. #****************************************************************************
  74. # Output
  75. #****************************************************************************
  76. ${OUTPUT}: ${OBJS}
  77. ${LD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS}
  78. #****************************************************************************
  79. # common rules
  80. #****************************************************************************
  81. # Rules for compiling source files to object files
  82. %.o : %.cpp
  83. ${CXX} -c ${CXXFLAGS} ${INCS} $< -o $@
  84. %.o : %.c
  85. ${CC} -c ${CFLAGS} ${INCS} $< -o $@
  86. dist:
  87. bash makedistlinux
  88. clean:
  89. -rm -f core ${OBJS} ${OUTPUT}
  90. depend:
  91. #makedepend ${INCS} ${SRCS}
  92. tinyxml.o: tinyxml.h tinystr.h
  93. tinyxmlparser.o: tinyxml.h tinystr.h
  94. xmltest.o: tinyxml.h tinystr.h
  95. tinyxmlerror.o: tinyxml.h tinystr.h