-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile.static
85 lines (70 loc) · 1.45 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
TARGET=libplist.a
TARGETXX=libplist++.a
ifdef LIBXML2_DIR
XMLDIR=$(LIBXML2_DIR)
else
XMLDIR=../libxml2
endif
CFLAGS=-m32 -Iinclude -Ilibcnary/include -I$(XMLDIR)/include -Wall -O3 -DLIBXML_STATIC=1
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
endif
ifeq ($(UNAME), Linux)
CFLAGS+=-fPIC
endif
CXXFLAGS=$(CFLAGS)
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
endif
objects= \
libcnary/iterator.o \
libcnary/list.o \
libcnary/node.o \
libcnary/node_iterator.o \
libcnary/node_list.o \
src/base64.o \
src/bplist.o \
src/bytearray.o \
src/hashtable.o \
src/plist.o \
src/ptrarray.o \
src/xplist.o \
objectsxx= \
src/Node.cpp.o \
src/Boolean.cpp.o \
src/Integer.cpp.o \
src/Real.cpp.o \
src/String.cpp.o \
src/Date.cpp.o \
src/Data.cpp.o \
src/Structure.cpp.o \
src/Array.cpp.o \
src/Dictionary.cpp.o \
all: $(TARGET) $(TARGETXX)
%.o: %.c
$(CC) -o $@ $(CFLAGS) -c $<
%.cpp.o: %.cpp
$(CXX) -o $@ $(CXXFLAGS) -c $<
$(TARGET): $(objects)
$(AR) rcs $@ $^
$(TARGETXX): $(objectsxx)
$(AR) rcs $@ $^
clean:
rm -f libcnary/*.o src/*.o $(TARGET) $(TARGETXX)