aboutsummaryrefslogtreecommitdiff
path: root/vendor/voclient/common/Makefile
blob: 75c735f6ac5a4a6857ac4904be128847442e8247 (plain) (blame)
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
85
86
87
88
89
#///////////////////////////////////////////////////////////////////////////////
#//
#//  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 cfitsio 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)

cfitsio::
	(cd cfitsio ; /bin/csh -f mklibs)

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)
	(cd cfitsio   	; make clean)

distclean:
	(if [ "${PLATFORM}" != "Darwin" ]; then (cd curl ; make distclean); fi)
	(cd expat     	; make distclean)
	#(cd cfitsio   	; 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 $@