-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile.static
70 lines (62 loc) · 1.8 KB
/
Makefile.static
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
64
65
66
67
68
69
70
TARGET=libxml2.a
CFLAGS=-m32 -Iinclude -Wall -Os -Wno-pointer-sign -DHAVE_CONFIG_H
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
check_arch = $(shell if as -arch $(1) -o /dev/null < /dev/null > /dev/null; then echo yes; else echo no; fi)
ifeq ($(call check_arch,i386), yes)
CFLAGS+=-arch i386
endif
ifeq ($(call check_arch,ppc), yes)
CFLAGS+=-arch ppc
endif
CFLAGS+=-fPIC \
-DHAVE_GETADDRINFO=1 \
-DHAVE_SYS_SOCKET_H=1 \
-DHAVE_NETINET_IN_H=1 \
-DHAVE_ARPA_INET_H=1 \
-DHAVE_NETDB_H=1 \
-DHAVE_ARPA_NAMESER_H=1 \
-DHAVE_RESOLV_H=1 \
-DHAVE_POLL_H=1 \
-DHAVE_SYS_SELECT_H=1 \
-DSUPPORT_IP6=1 \
-DHAVE_PTHREAD_H=1 \
-DLIBXML_THREAD_ENABLED=1 \
-DLIBXML_ICONV_ENABLED
endif
ifeq ($(UNAME), Linux)
CFLAGS+=-fPIC \
-DHAVE_GETADDRINFO=1 \
-DHAVE_SYS_SOCKET_H=1 \
-DHAVE_NETINET_IN_H=1 \
-DHAVE_ARPA_INET_H=1 \
-DHAVE_NETDB_H=1 \
-DHAVE_ARPA_NAMESER_H=1 \
-DHAVE_RESOLV_H=1 \
-DHAVE_POLL_H=1 \
-DHAVE_SYS_SELECT_H=1 \
-DSUPPORT_IP6=1 \
-DHAVE_PTHREAD_H=1 \
-DLIBXML_THREAD_ENABLED=1 \
-DLIBXML_ICONV_ENABLED=1
endif
WIN32=
ifeq ($(findstring CYG,$(UNAME)), CYG)
WIN32=1
CC=gcc-3
endif
ifeq ($(findstring MINGW,$(UNAME)), MINGW)
WIN32=1
CC=gcc
endif
ifdef WIN32
CFLAGS+=-DWIN32 -DHAVE_WIN32_THREADS=1
endif
objects=SAX.o entities.o encoding.o error.o parserInternals.o parser.o tree.o hash.o list.o xmlIO.o xmlmemory.o uri.o valid.o xlink.o HTMLparser.o HTMLtree.o debugXML.o xpath.o xpointer.o xinclude.o nanohttp.o nanoftp.o DOCBparser.o catalog.o globals.o threads.o c14n.o xmlstring.o xmlregexp.o xmlschemas.o xmlschemastypes.o xmlunicode.o xmlreader.o relaxng.o dict.o SAX2.o xmlwriter.o legacy.o chvalid.o pattern.o xmlsave.o xmlmodule.o schematron.o
all: $(TARGET)
%.o: %.c
$(CC) -o $@ $(CFLAGS) -c $<
$(TARGET): $(objects)
$(AR) rcs $(TARGET) $^
clean:
rm -f *.o $(TARGET)