blob: ee8fbffd12d829f84bcf1e6538a3fd75a08beddd [file] [log] [blame]
Bryan Duxbury7173bd92010-05-02 22:54:22 +00001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
20# directory where erlang library code should live
21ERL_LIB_ROOT_DIR=$(shell erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell)
22
23MODULES = \
24 src
25
26all clean docs:
27 for dir in $(MODULES); do \
28 (cd $$dir; ${MAKE} $@); \
29 done
30
31ERLLIBDIR=$(DESTDIR)$(ERL_LIB_ROOT_DIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
32
33install: all
34 mkdir -p $(ERLLIBDIR) ; \
35 mkdir -p $(ERLLIBDIR)/ebin ; \
36 mkdir -p $(ERLLIBDIR)/include ; \
37 mkdir -p $(ERLLIBDIR)/src ; \
38 for i in ebin/*.app* ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \
39 for i in ebin/*.beam ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \
40 for i in include/*.hrl ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \
41 for i in src/*.erl ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done
42
43uninstall:
44 rm -rf $(ERLLIBDIR)
45
46check: all
47
48distclean: clean
49
50# Hack to make "make dist" work.
51# This should not work, but it appears to.
52distdir:
53
54MAINTAINERCLEANFILES = Makefile.in
55
56maintainer-clean:
57 test ! -d ebin || rm -rf ebin