Makefile

Fri, 06 Sep 2013 13:20:20 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 06 Sep 2013 13:20:20 +0200
changeset 152
3238f65db163
parent 103
08018864fb91
child 154
8346aebfbb7b
permissions
-rw-r--r--

minor code fixes + added clang support + improved build system

olaf@0 1 #
olaf@0 2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
olaf@0 3 #
universe@103 4 # Copyright 2013 Olaf Wintermann. All rights reserved.
olaf@0 5 #
olaf@0 6 # Redistribution and use in source and binary forms, with or without
olaf@0 7 # modification, are permitted provided that the following conditions are met:
olaf@0 8 #
olaf@0 9 # 1. Redistributions of source code must retain the above copyright
olaf@0 10 # notice, this list of conditions and the following disclaimer.
olaf@0 11 #
olaf@0 12 # 2. Redistributions in binary form must reproduce the above copyright
olaf@0 13 # notice, this list of conditions and the following disclaimer in the
olaf@0 14 # documentation and/or other materials provided with the distribution.
olaf@0 15 #
olaf@0 16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
olaf@0 17 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
olaf@0 18 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
olaf@0 19 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
olaf@0 20 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
olaf@0 21 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
olaf@0 22 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
olaf@0 23 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
olaf@0 24 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
olaf@0 25 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
olaf@0 26 # POSSIBILITY OF SUCH DAMAGE.
olaf@0 27 #
olaf@0 28
olaf@0 29
olaf@0 30 #
olaf@0 31 # available configurations:
universe@152 32 # clang, clang-debug
universe@152 33 # gcc, gcc-debug
universe@152 34 # g++, g++-debug
universe@152 35 # osx, osx-debug
universe@152 36 # suncc, suncc-debug
olaf@0 37 # windows
olaf@0 38 #
olaf@0 39
universe@152 40 CONF=gcc
universe@152 41 PREFIX=/usr/local
olaf@0 42
universe@152 43 include unix.mk
olaf@0 44 include $(CONF).mk
olaf@0 45
olaf@0 46 ucx: FORCE
olaf@0 47 cd ucx; $(MAKE) CONF=$(CONF) all
olaf@0 48
olaf@0 49 test: FORCE ucx
olaf@0 50 cd test; $(MAKE) CONF=$(CONF) all
olaf@0 51
olaf@0 52 run: FORCE test
olaf@1 53 ./build/test$(APP_EXT)
olaf@0 54
universe@152 55 install: ucx | $(PREFIX)/include/ucx $(PREFIX)/lib
universe@152 56 cp ./build/libucx$(LIB_EXT) $(PREFIX)/lib && \
universe@152 57 cp ./ucx/*.h $(PREFIX)/include/ucx
universe@152 58
universe@152 59 uninstall:
universe@152 60 $(RM) $(RMFLAGS) $(PREFIX)/include/ucx &&\
universe@152 61 $(RM) $(RMFLAGS) $(PREFIX)/lib/libucx$(LIB_EXT)
universe@152 62
universe@152 63 $(PREFIX)/lib:
universe@152 64 mkdir -p $(PREFIX)/lib
universe@152 65
universe@152 66 $(PREFIX)/include/ucx:
universe@152 67 mkdir -p $(PREFIX)/include/ucx
universe@152 68
olaf@0 69 clean: FORCE
universe@152 70 $(RM) $(RMFLAGS) build
olaf@0 71
olaf@0 72 FORCE:
olaf@0 73

mercurial