2 # (c) 2006 Jan Lehnardt <jan@php.net>
3 # This program is Free Software. See license.txt
6 UNICODE_INCLUDE_DIR ?
= $(shell icu-config
--prefix)
7 UNICODE_LIB_DIR ?
= $(shell icu-config
--icudata-install-dir
)
8 ERLANG_INCLUDE_DIR ?
= /usr
/lib
/erlang
/driver
9 COUCHDB_INSTALL_DIR ?
= /usr
/local
/couchdb
18 INSTALL ?
= /usr
/bin
/install
21 LDFLAGS
=-L
$(UNICODE_LIB_DIR
) -L
$(BUILD_DIR
)/
24 cp
-R
dist/common
/* $(COUCHDB_INSTALL_DIR
)/
25 mkdir
$(COUCHDB_INSTALL_DIR
)/lib
$(COUCHDB_INSTALL_DIR
)/bin
$(COUCHDB_INSTALL_DIR
)/boot
$(COUCHDB_INSTALL_DIR
)/js
26 cp src
/js
/js src
/js
/json.js src
/js
/main.js
$(COUCHDB_INSTALL_DIR
)/js
/
27 cp
dist/unix
/bin
/startCouchDb.sh
$(COUCHDB_INSTALL_DIR
)/bin
/
28 cp
$(BUILD_DIR
)/couch_erl_driver.so
$(COUCHDB_INSTALL_DIR
)/lib
/
29 mv
$(COUCHDB_INSTALL_DIR
)/couch_httpd.conf.src
$(COUCHDB_INSTALL_DIR
)/couch_httpd.conf
30 .
/dist/unix
/bin
/config.sh
31 mv .
/dist/unix
/couch.ini
$(COUCHDB_INSTALL_DIR
)/
32 mv .
/dist/unix
/bin
/couch_erl
$(COUCHDB_INSTALL_DIR
)/bin
/couch_erl
33 chmod
+x
$(COUCHDB_INSTALL_DIR
)/bin
/couch_erl
35 cp couch.boot
$(COUCHDB_INSTALL_DIR
)/boot
/
37 $(ERL
) -noshell
-run build_couch output_full_libs
$(COUCHDB_INSTALL_DIR
)
41 couchdb
: host
$(BUILD_DIR
)/couch_erl_driver.so build
/build_couch.beam build
/couch.boot
42 cd src
/js
&& make
-f Makefile.ref
&& cd ..
/..
/
43 # $(ERL) -noshell -run build/build_couch compile_all
45 @echo
"CouchDb has been built successfully!"
48 ifeq ($(strip $(HOST
)),)
49 @echo
"Cannot determine HOST. exiting...";
54 $(BUILD_DIR
)/couch_erl_driver.so
:
56 $(GCC
) -w
-rdynamic
-shared
-fPIC
-I
$(UNICODE_INCLUDE_DIR
) -I
$(ERLANG_INCLUDE_DIR
) src
/CouchDb
/couch_erl_driver.c
$(LDFLAGS
) -o
$(BUILD_DIR
)/couch_erl_driver.so
-licuuc
-licudata
-licui18n
60 $(GCC
) -w
-bundle
-flat_namespace
-undefined suppress
-I
$(UNICODE_INCLUDE_DIR
) -I
$(ERLANG_INCLUDE_DIR
) src
/CouchDb
/couch_erl_driver.c
$(LDFLAGS
) -o
$(BUILD_DIR
)/couch_erl_driver.so
-licudata
-licuuc
-licui18n
65 $(ERL
) -noshell
-run build_couch compile_all
67 build
/build_couch.beam
: build
/build_couch.erl
68 $(ERLC
) build
/build_couch.erl
71 clean: clean_all clean_js
74 @cd src
/js
; make
-f Makefile.ref
clobber
77 rm -rf src
/CouchDb
/*.beam src
/couch_inets
/*.beam build
/couch.rel build
/couch.app build
/couch_erl_driver.so build_couch.beam couch.script couch.boot
79 .PHONY
: clean CouchDb host
dist clean_js