1
0

Makefile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. SHELL = /bin/sh
  2. #### Start of system configuration section. ####
  3. srcdir = .
  4. topdir = /usr/lib/ruby/1.8/i686-linux
  5. hdrdir = $(topdir)
  6. VPATH = $(srcdir):$(topdir):$(hdrdir)
  7. prefix = $(DESTDIR)/usr
  8. exec_prefix = $(prefix)
  9. oldincludedir = $(DESTDIR)/usr/include
  10. localstatedir = $(DESTDIR)/var
  11. localedir = $(datarootdir)/locale
  12. pdfdir = $(docdir)
  13. libdir = $(exec_prefix)/lib
  14. sbindir = $(exec_prefix)/sbin
  15. sitearchdir = $(sitelibdir)/$(sitearch)
  16. vendorlibdir = $(vendordir)/$(ruby_version)
  17. datarootdir = $(prefix)/share
  18. docdir = $(datarootdir)/doc/$(PACKAGE)
  19. sitelibdir = $(sitedir)/$(ruby_version)
  20. sitedir = $(DESTDIR)/usr/local/lib/site_ruby
  21. sharedstatedir = $(prefix)/com
  22. dvidir = $(docdir)
  23. psdir = $(docdir)
  24. libexecdir = $(prefix)/lib/ruby1.8
  25. archdir = $(rubylibdir)/$(arch)
  26. includedir = $(prefix)/include
  27. vendorarchdir = $(vendorlibdir)/$(sitearch)
  28. sysconfdir = $(DESTDIR)/etc
  29. bindir = $(exec_prefix)/bin
  30. htmldir = $(docdir)
  31. mandir = $(prefix)/share/man
  32. datadir = $(datarootdir)
  33. rubylibdir = $(libdir)/ruby/$(ruby_version)
  34. vendordir = $(libdir)/ruby/vendor_ruby
  35. infodir = $(prefix)/share/info
  36. CC = gcc
  37. LIBRUBY = $(LIBRUBY_SO)
  38. LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
  39. LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
  40. LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
  41. RUBY_EXTCONF_H =
  42. CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC $(cflags)
  43. INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
  44. DEFS = -D_FILE_OFFSET_BITS=64 -DWATCHMAN_BUILD
  45. CPPFLAGS = -DHAVE_FCNTL_H -DHAVE_SYS_ERRNO_H -DHAVE_SYS_SOCKET_H -DHAVE_ST_H -D_FORTIFY_SOURCE=2 $(DEFS) $(cppflags)
  46. CXXFLAGS = $(CFLAGS)
  47. ldflags = -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic -Wl,-export-dynamic
  48. dldflags =
  49. archflag =
  50. DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
  51. LDSHARED = $(CC) -shared
  52. AR = ar
  53. EXEEXT =
  54. RUBY_INSTALL_NAME = ruby1.8
  55. RUBY_SO_NAME = ruby1.8
  56. arch = i686-linux
  57. sitearch = i686-linux
  58. ruby_version = 1.8
  59. ruby = /usr/bin/ruby1.8
  60. RUBY = $(ruby)
  61. RM = rm -f
  62. MAKEDIRS = mkdir -p
  63. INSTALL = /usr/bin/install -c
  64. INSTALL_PROG = $(INSTALL) -m 0755
  65. INSTALL_DATA = $(INSTALL) -m 644
  66. COPY = cp
  67. #### End of system configuration section. ####
  68. preload =
  69. libpath = . $(libdir)
  70. LIBPATH = -L. -L$(libdir)
  71. DEFFILE =
  72. CLEANFILES = mkmf.log
  73. DISTCLEANFILES =
  74. extout =
  75. extout_prefix =
  76. target_prefix =
  77. LOCAL_LIBS =
  78. LIBS = $(LIBRUBYARG_SHARED) -lpthread -lrt -ldl -lcrypt -lm -lc
  79. SRCS = watchman.c match.c matcher.c ext.c
  80. OBJS = watchman.o match.o matcher.o ext.o
  81. TARGET = ext
  82. DLLIB = $(TARGET).so
  83. EXTSTATIC =
  84. STATIC_LIB =
  85. BINDIR = $(bindir)
  86. RUBYCOMMONDIR = $(sitedir)$(target_prefix)
  87. RUBYLIBDIR = $(sitelibdir)$(target_prefix)
  88. RUBYARCHDIR = $(sitearchdir)$(target_prefix)
  89. TARGET_SO = $(DLLIB)
  90. CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
  91. CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
  92. all: $(DLLIB)
  93. static: $(STATIC_LIB)
  94. clean:
  95. @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
  96. distclean: clean
  97. @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
  98. @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
  99. realclean: distclean
  100. install: install-so install-rb
  101. install-so: $(RUBYARCHDIR)
  102. install-so: $(RUBYARCHDIR)/$(DLLIB)
  103. $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
  104. $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
  105. install-rb: pre-install-rb install-rb-default
  106. install-rb-default: pre-install-rb-default
  107. pre-install-rb: Makefile
  108. pre-install-rb-default: Makefile
  109. $(RUBYARCHDIR):
  110. $(MAKEDIRS) $@
  111. site-install: site-install-so site-install-rb
  112. site-install-so: install-so
  113. site-install-rb: install-rb
  114. .SUFFIXES: .c .m .cc .cxx .cpp .C .o
  115. .cc.o:
  116. $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
  117. .cxx.o:
  118. $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
  119. .cpp.o:
  120. $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
  121. .C.o:
  122. $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
  123. .c.o:
  124. $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
  125. $(DLLIB): $(OBJS) Makefile
  126. @-$(RM) $@
  127. $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
  128. ###
  129. # Copyright 2010-2014 Wincent Colaiuta. All rights reserved.
  130. #
  131. # Redistribution and use in source and binary forms, with or without
  132. # modification, are permitted provided that the following conditions are met:
  133. #
  134. # 1. Redistributions of source code must retain the above copyright notice,
  135. # this list of conditions and the following disclaimer.
  136. # 2. Redistributions in binary form must reproduce the above copyright notice,
  137. # this list of conditions and the following disclaimer in the documentation
  138. # and/or other materials provided with the distribution.
  139. #
  140. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  141. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  142. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  143. # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
  144. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  145. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  146. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  147. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  148. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  149. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  150. # POSSIBILITY OF SUCH DAMAGE.
  151. CFLAGS += -Wall -Wextra -Wno-unused-parameter