Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #
  2. # Copyright (c) 2007, Cameron Rich
  3. #
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are met:
  8. #
  9. # * Redistributions of source code must retain the above copyright notice,
  10. # this list of conditions and the following disclaimer.
  11. # * Redistributions in binary form must reproduce the above copyright
  12. # notice, this list of conditions and the following disclaimer in the
  13. # documentation and/or other materials provided with the distribution.
  14. # * Neither the name of the axTLS project nor the names of its
  15. # contributors may be used to endorse or promote products derived
  16. # from this software without specific prior written permission.
  17. #
  18. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  22. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  24. # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  26. # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  27. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  28. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. #
  30. all : web_server lua
  31. AXTLS_HOME=..
  32. include $(AXTLS_HOME)/config/.config
  33. include $(AXTLS_HOME)/config/makefile.conf
  34. ifndef CONFIG_PLATFORM_WIN32
  35. ifdef CONFIG_PLATFORM_CYGWIN
  36. TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd.exe
  37. TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd.exe
  38. else
  39. TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd
  40. TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd
  41. endif
  42. ifdef CONFIG_HTTP_STATIC_BUILD
  43. LIBS=$(AXTLS_HOME)/$(STAGE)/libaxtls.a
  44. else
  45. LIBS=-L$(AXTLS_HOME)/$(STAGE) -laxtls
  46. endif
  47. ifdef CONFIG_HTTP_BUILD_LUA
  48. lua: kepler-1.1
  49. kepler-1.1:
  50. @tar xvfz kepler-1.1-snapshot-20070521-1825.tar.gz
  51. @cat kepler.patch | patch -p0
  52. cd kepler-1.1; ./configure --prefix=$(CONFIG_HTTP_LUA_PREFIX) --launcher=cgi --lua-suffix= ; make install
  53. else
  54. lua:
  55. endif
  56. else # win32 build
  57. lua:
  58. TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd.exe
  59. TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd.exe
  60. ifdef CONFIG_HTTP_STATIC_BUILD
  61. LIBS=$(AXTLS_HOME)/$(STAGE)/axtls.static.lib $(AXTLS_HOME)\\config\\axtls.res
  62. else
  63. LIBS=$(AXTLS_HOME)/$(STAGE)/axtls.lib $(AXTLS_HOME)\\config\\axtls.res
  64. endif
  65. endif
  66. ifndef CONFIG_AXHTTPD
  67. web_server:
  68. else
  69. web_server :: $(TARGET)
  70. ifdef CONFIG_HTTP_HAS_AUTHORIZATION
  71. web_server :: $(TARGET2)
  72. endif
  73. OBJ= \
  74. axhttpd.o \
  75. proc.o \
  76. tdate_parse.o
  77. include $(AXTLS_HOME)/config/makefile.post
  78. ifndef CONFIG_PLATFORM_WIN32
  79. $(TARGET): $(OBJ) $(AXTLS_HOME)/$(STAGE)/libaxtls.a
  80. $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
  81. ifdef CONFIG_STRIP_UNWANTED_SECTIONS
  82. $(STRIP) --remove-section=.comment $(TARGET)
  83. endif
  84. $(TARGET2): htpasswd.o $(AXTLS_HOME)/$(STAGE)/libaxtls.a
  85. $(LD) $(LDFLAGS) -o $@ htpasswd.o $(LIBS)
  86. else # Win32
  87. OBJ:=$(OBJ:.o=.obj)
  88. %.obj : %.c
  89. $(CC) $(CFLAGS) $<
  90. htpasswd.obj : htpasswd.c
  91. $(CC) $(CFLAGS) $?
  92. $(TARGET): $(OBJ)
  93. $(LD) $(LDFLAGS) /out:$@ $(LIBS) $?
  94. $(TARGET2): htpasswd.obj
  95. $(LD) $(LDFLAGS) /out:$@ $(LIBS) $?
  96. endif
  97. endif # CONFIG_AXHTTPD
  98. clean::
  99. -@rm -f $(TARGET)*
  100. -@rm -fr kepler-1.1