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