Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 1 | # |
| 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 |
| 21 | ERL_LIB_ROOT_DIR=$(shell erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell) |
| 22 | |
| 23 | MODULES = \ |
| 24 | src |
| 25 | |
| 26 | all clean docs: |
| 27 | for dir in $(MODULES); do \ |
| 28 | (cd $$dir; ${MAKE} $@); \ |
| 29 | done |
| 30 | |
| 31 | ERLLIBDIR=$(DESTDIR)$(ERL_LIB_ROOT_DIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) |
| 32 | |
| 33 | install: 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 | |
| 43 | uninstall: |
| 44 | rm -rf $(ERLLIBDIR) |
| 45 | |
| 46 | check: all |
| 47 | |
| 48 | distclean: clean |
| 49 | |
| 50 | # Hack to make "make dist" work. |
| 51 | # This should not work, but it appears to. |
| 52 | distdir: |
| 53 | |
| 54 | MAINTAINERCLEANFILES = Makefile.in |
| 55 | |
| 56 | maintainer-clean: |
| 57 | test ! -d ebin || rm -rf ebin |