-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
84 lines (65 loc) · 1.92 KB
/
Makefile
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
#///////////////////////////////////////////////////////////////////////////////
#//
#// Makefile for the common libraries
#//
#///////////////////////////////////////////////////////////////////////////////
# primary dependencies
NAME = Common
VERSION = 1.0
PLATFORM := $(shell uname -s)
PLMACH := $(shell uname -m)
HERE := $(shell /bin/pwd)
BINDIR := ../bin/
LIBDIR := ../lib/
INCDIR := ../include/
# includes, flags and libraries
CC = gcc
CINCS = -I$(INCDIR) -I./
ifeq ($(PLATFORM),Darwin)
ifeq ($(PLATFORM),x86_64)
CARCH = -m64 -mmacosx-version-min=10.5
else
CARCH = -mmacosx-version-min=10.5
endif
LIBS = -lm -lc
else
CARCH =
LIBS = -lm -lc -lpthread
endif
CFLAGS = -g -Wall $(CARCH) -D$(PLATFORM) $(CINCS) -L./
all:: expat curl
libs::
(/bin/csh -f mklibs)
(cd expat ; ./configure --prefix=${HERE}/../; \ make ; make installlib)
curl::
(/bin/csh -f mklibs)
expat::
(cd expat ; ./configure --prefix=${HERE}/../; \ make ; make installlib)
apps:
install:
(if [ "${PLATFORM}" != "Darwin" ]; then (cd curl ; make install); fi)
(cd expat ; make install)
(/bin/rm -rf ../man ../share)
clean:
(if [ "${PLATFORM}" != "Darwin" ]; then (cd curl ; make clean); fi)
(cd expat ; make clean)
distclean:
(if [ "${PLATFORM}" != "Darwin" ]; then (cd curl ; make distclean); fi)
(cd expat ; make distclean)
###############################################################################
# Leave this stuff alone.
###############################################################################
$(STATICLIB): $(SRCS:%.c=Static/%.o)
/usr/bin/ar rv $@ $?
Static/%.o: %.c $(INCS)
/usr/bin/gcc $(CINCS) $(CFLAGS) -c $< -o $@
Static:
/bin/mkdir $@
chmod 777 $@
$(SHAREDLIB): $(SRCS:%.c=Shared/%.o)
/usr/bin/ld -shared -o $@ $? -lc -ldl
Shared/%.o: %.c $(INCS)
/usr/bin/gcc $(CINCS) $(CFLAGS) -fpic -shared -c $< -o $@
Shared:
/bin/mkdir $@
chmod 777 $@