2
0

makefile.conf 4.0 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. #
  31. # A standard makefile for all makefiles
  32. #
  33. # All executables and libraries go here
  34. STAGE=./_stage
  35. ifneq ($(MAKECMDGOALS), clean)
  36. # Give an initial rule
  37. all:
  38. # Win32
  39. ifdef CONFIG_PLATFORM_WIN32
  40. ifdef CONFIG_VISUAL_STUDIO_7_0
  41. CONFIG_VISUAL_STUDIO_7_0_BASE_UNIX:=$(shell cygpath -u $(CONFIG_VISUAL_STUDIO_7_0_BASE))
  42. export INCLUDE=$(shell echo "$(CONFIG_VISUAL_STUDIO_7_0_BASE)\vc7\include;$(CONFIG_VISUAL_STUDIO_7_0_BASE)\vc7\platformsdk\include")
  43. export LIB=$(shell echo "$(CONFIG_VISUAL_STUDIO_7_0_BASE)\vc7\\platformsdk\lib;$(CONFIG_VISUAL_STUDIO_7_0_BASE)\vc7\lib")
  44. PATH:=$(CONFIG_VISUAL_STUDIO_7_0_BASE_UNIX)/vc7/bin:$(CONFIG_VISUAL_STUDIO_7_0_BASE_UNIX)/common7/ide:$(PATH)
  45. else
  46. ifdef CONFIG_VISUAL_STUDIO_8_0
  47. CONFIG_VISUAL_STUDIO_8_0_BASE_UNIX:=$(shell cygpath -u $(CONFIG_VISUAL_STUDIO_8_0_BASE))
  48. export INCLUDE=$(shell echo "$(CONFIG_VISUAL_STUDIO_8_0_BASE)\vc\include;$(CONFIG_VISUAL_STUDIO_8_0_BASE)\vc\platformsdk\include")
  49. export LIB=$(shell echo "$(CONFIG_VISUAL_STUDIO_8_0_BASE)\vc\platformsdk\lib;$(CONFIG_VISUAL_STUDIO_8_0_BASE)\vc\lib")
  50. PATH:=$(CONFIG_VISUAL_STUDIO_8_0_BASE_UNIX)/vc/bin:$(CONFIG_VISUAL_STUDIO_8_0_BASE_UNIX)/common7/ide:$(PATH)
  51. stuff:
  52. @echo $(INCLUDE)
  53. endif
  54. endif
  55. CC=cl.exe
  56. LD=link.exe
  57. AXTLS_INCLUDE=$(shell cygpath -w $(AXTLS_HOME))
  58. CFLAGS+=/nologo /W3 /D"WIN32" /D"_MBCS" /D"_CONSOLE" /D"_CRT_SECURE_NO_DEPRECATE" /FD /I"$(AXTLS_INCLUDE)crypto" /I"$(AXTLS_INCLUDE)ssl" /I"$(AXTLS_INCLUDE)config" /c
  59. LDFLAGS=/nologo /subsystem:console /machine:I386
  60. LDSHARED = /dll
  61. AR=lib /nologo
  62. ifdef CONFIG_DEBUG
  63. CFLAGS += /Gm /Zi /Od /D "_DEBUG"
  64. LDFLAGS += /debug /incremental:yes
  65. else
  66. CFLAGS += /O2 /D "NDEBUG"
  67. LDFLAGS += /incremental:no
  68. endif
  69. else # Not Win32
  70. -include .depend
  71. CFLAGS += -I$(AXTLS_HOME)/config -I$(AXTLS_HOME)/ssl -I$(AXTLS_HOME)/crypto
  72. LD=$(CC)
  73. STRIP=strip
  74. # Solaris
  75. ifdef CONFIG_PLATFORM_SOLARIS
  76. CFLAGS += -DCONFIG_PLATFORM_SOLARIS
  77. LDFLAGS += -lsocket -lnsl -lc
  78. LDSHARED = -G
  79. # Linux/Cygwin
  80. else
  81. CFLAGS += -Wall -Wstrict-prototypes -Wshadow
  82. LDSHARED = -shared
  83. # Linux
  84. ifndef CONFIG_PLATFORM_CYGWIN
  85. # CFLAGS += -fPIC
  86. # Cygwin
  87. else
  88. CFLAGS += -DCONFIG_PLATFORM_CYGWIN
  89. LDFLAGS += -enable-auto-import
  90. endif
  91. endif
  92. ifdef CONFIG_DEBUG
  93. CFLAGS += -g
  94. else
  95. LDFLAGS += -s
  96. ifdef CONFIG_PLATFORM_SOLARIS
  97. CFLAGS += -O
  98. else
  99. CFLAGS += -O3
  100. endif
  101. endif # CONFIG_DEBUG
  102. endif # WIN32
  103. CFLAGS+=$(subst ",, $(strip $(CONFIG_EXTRA_CFLAGS_OPTIONS)))
  104. LDFLAGS+=$(subst ",, $(strip $(CONFIG_EXTRA_LDFLAGS_OPTIONS)))
  105. endif # not 'clean'
  106. clean::
  107. -@rm -f *.o *.obj core* *.out *~ \.depend vc*0*