~francis-aspl/vortexlibrary/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- makefile -*- Makefile for windows (mingw)
OBJ  = vortex_sasl.o 

ifdef enable_vortex_log
   DLL = $(vortex_debug_sasl_1_1_dll).dll
   vortex_dll = -lvortex-debug-1.1
else
   DLL = $(vortex_sasl_1_1_dll).dll
   vortex_dll = -lvortex-1.1
endif
IMPORT_DLL = $(DLL).a
STATIC_LIB = $(vortex_sasl_1_1_dll).a

#LIBS = -Wall $(enable_gcc_debug) -L"$(BASE_DIR)/lib" \
#	-L"$(BASE_DIR)/bin" \
#	--add-stdcall-alias \
#	-lws2_32 \
#	-lintl  -liconv  -lm 
LIBS = -Wall $(enable_gcc_debug) $(AXL_LIBS) -L"../src" -L"../../libaxl/src/" -laxl -lws2_32 $(vortex_dll) $(OPENSSL_LIBS) $(GSASL_LIBS) $(search_lib_path) 

# build vortex with log support
INCS = -Wall $(enable_gcc_debug) $(AXL_INCLUDE) -I"." -I"../../libaxl/src" -I"../src" $(enable_vortex_log) -DENABLE_SASL_SUPPORT -DHAVE_GSASL_FREE

CFLAGS = $(INCS) -DVERSION=\""$(VORTEX_VERSION)"\" -D__axl_disable_broken_bool_def__  \
	-DPACKAGE_DTD_DIR=\""$(datadir)"\" -DPACKAGE_TOP_DIR=\""$(top_srcdir)"\" -Wall $(enable_gcc_debug) $(OPENSSL_FLAGS) $(GSASL_FLAGS)
RM = rm -f

.PHONY: all clean

all: $(DLL)

clean: 
	${RM} $(OBJ) $(DLL) *.a *.dll.a *.lib *.dll

install: all
	test -d $(INSTALL_DIR) || exit -1
	cp libvortex-sasl-1.1.dll $(INSTALL_DIR)

$(DLL): $(OBJ)
# add the following line to create an import library. At this point this step
# is not requiered because gcc automatically get an import library from the dll.
# -Wl,--out-implib,libvortex-1.1.lib
	$(CC) -m$(MODE) -shared -Wl,--out-implib,$(IMPORT_DLL) $(export_all_symbols) \
		  $(OBJ) -o $(DLL)        $(LIBS)
	lib.exe /machine:$(link_machine)  /def:libvortex-sasl-1.1.def
ifdef enable_vortex_log
	cp libvortex-sasl-1.1.lib $(release_dir)/libvortex-sasl-debug-1.1.lib
	cp libvortex-sasl-1.1.def $(release_dir)/libvortex-sasl-debug-1.1.def
	cp libvortex-sasl-1.1.exp $(release_dir)/libvortex-sasl-debug-1.1.exp
else
	cp libvortex-sasl-1.1.lib $(release_dir)/
	cp libvortex-sasl-1.1.def $(release_dir)/
	cp libvortex-sasl-1.1.exp $(release_dir)/
endif
ifndef enable_gcc_debug
       # only strip if not debug
	strip --strip-unneeded $(DLL)
endif
	cp $(DLL) $(release_dir)/
	cp $(DLL).a $(release_dir)/

%.o: %.c
	$(CC) -c $< -o $@ $(CFLAGS)