Build: add a top-level clean target
[steamworks] / Makefile
1 # Copyright (c) 2014, 2015 InternetWide.org and the ARPA2.net project
2 # All rights reserved.
3 #
4 # See the LICENSE file for details.
5 #
6 # Top-level bogus makefile for the Steamworks project. The real
7 # build-system is CMake. This makefile just arranges for an out-
8 # of-source build in a new subdirectory.
9 #
10 PREFIX ?= /usr/local
11
12 # Set CMAKE_ARGS to influence the configuration. Here
13 # are some examples, with the default settings assigned.
14 # Take care that *_DIR variables must have a trailing / .
15 #
16 # CMAKE_ARGS += -DPULLEY_SQUEAL_DIR=/var/db/
17 # CMAKE_ARGS += -DPULLEY_BACKEND_DIR=$(PREFIX)/share/steamworks/pulleyback/
18
19 all: build
20
21 check-build:
22         test -d build/ || mkdir build
23         test -d build
24
25 check-cmake: check-build
26         test -f build/Makefile || ( cd build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=$(PREFIX) $(CMAKE_ARGS) ../src )
27         test -f build/Makefile
28
29 build: check-cmake
30         ( cd build ; $(MAKE) )
31
32 install: build
33         ( cd build ; $(MAKE) install PREFIX=$PREFIX )
34
35 clean:
36         rm -rf build
37