1##----------------------------------------------------------------
2##
3##-- Filename: Makefile
4##
5##-- $Date: 2008/02/23 02:56:17 $
6##-- $Revision: 1.2 $
7##-- $Name:  $
8##
9##----------------------------------------------------------------
10
11NAME = xml2
12TOOL_FAMILY=gnu
13
14include $(WIND_USR)/tool/gnu/make.$(VXCPU)
15
16FLAGS = -Wall -g -Isrc -Isrc/include -D_REENTRANT=1
17#FLAGS = -Wall -O2 -Isrc -Isrc/include -D_REENTRANT=1
18
19FLAGS += $(DEFINE_CC) $(CC_ARCH_SPEC) -MD -MP -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=gnu -D_VX_TOOL=$(TOOL)
20ifeq ($(VXTYPE),RTP)
21FLAGS += -mrtp -fpic -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip
22else
23FLAGS += -D_WRS_KERNEL -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip
24endif
25
26ifeq ($(VXTYPE),RTP)
27ifeq ($(CPU),SH32)
28LIB_LDFLAGS += -L$(WIND_USR)/lib/sh/SH32/commonle/PIC
29else
30LIB_LDFLAGS += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS)
31endif
32endif
33
34OBJS =	c14n.o catalog.o chvalid.o \
35		debugXML.o dict.o DOCBparser.o \
36		encoding.o entities.o error.o \
37		globals.o \
38		hash.o \
39		legacy.o list.o \
40		parser.o parserInternals.o pattern.o \
41		relaxng.o \
42		SAX2.o SAX.o schematron.o \
43		threads.o tree.o \
44		uri.o \
45		valid.o \
46		xinclude.o xlink.o xmlcatalog.o xmlIO.o \
47		xmlmemory.o xmlmodule.o xmlreader.o xmlregexp.o \
48		xmlsave.o xmlschemas.o xmlschemastypes.o xmlstring.o \
49		xmlunicode.o xmlwriter.o xpath.o xpointer.o
50
51all : lib$(NAME).so
52
53init :
54	mkdir -p objs
55
56.PHONY : lib$(NAME).so
57
58lib$(NAME).so : init $(patsubst %.o, objs/%.o, $(OBJS))
59	$(CC) $(FLAGS) $(LIB_LDFLAGS) -shared -o $@ $(patsubst %.o, objs/%.o, $(OBJS))
60
61(NAME).out : init $(patsubst %.o, objs/%.o, $(OBJS))
62	$(CC) $(FLAGS) -o $@ $(patsubst %.o, objs/%.o, $(OBJS))
63
64objs/%.o: src/%.c
65	 $(CC) $(FLAGS) -o $@ -c $<
66
67clean:
68	rm -fR *.so objs
69