diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -5,18 +5,26 @@ | |||
5 | # terms of the license contained in the file LICENSE. | 5 | # terms of the license contained in the file LICENSE. |
6 | # | 6 | # |
7 | 7 | ||
8 | PREFIX := /home/eichlan/testroot | ||
8 | OBJECTS := $(patsubst %.cpp,%.o,$(wildcard src/stable/*.cpp src/unstable/*.cpp src/experimental/*.cpp)) | 9 | OBJECTS := $(patsubst %.cpp,%.o,$(wildcard src/stable/*.cpp src/unstable/*.cpp src/experimental/*.cpp)) |
9 | HEADERS := bu bu/signals.h bu/autoconfig.h bu/version.h bu/config.h $(foreach fn,$(wildcard src/stable/*.h src/unstable/*.h src/experimental/*.h),bu/$(notdir ${fn})) $(patsubst src/%,bu/%,$(wildcard src/compat/*.h)) | 10 | HEADERS := bu/signals.h bu/autoconfig.h bu/version.h bu/config.h $(foreach fn,$(wildcard src/stable/*.h src/unstable/*.h src/experimental/*.h),bu/$(notdir ${fn})) $(patsubst src/%,bu/%,$(wildcard src/compat/*.h)) |
10 | TOOLS := $(patsubst src/tools/%.cpp,%,$(wildcard src/tools/*.cpp)) | 11 | TOOLS := $(patsubst src/tools/%.cpp,%,$(wildcard src/tools/*.cpp)) |
11 | UNITS := $(patsubst src/unit/%.unit,unit/%,$(wildcard src/unit/*.unit)) | 12 | UNITS := $(patsubst src/unit/%.unit,unit/%,$(wildcard src/unit/*.unit)) |
12 | TESTS := $(patsubst src/tests/%.cpp,tests/%,$(wildcard src/tests/*.cpp)) | 13 | TESTS := $(patsubst src/tests/%.cpp,tests/%,$(wildcard src/tests/*.cpp)) |
13 | 14 | ||
14 | .PHONY: default all headers clean tests | 15 | .PHONY: default all headers clean tests install |
15 | 16 | ||
16 | default: libbu++.a tools | 17 | default: libbu++.a tools |
17 | 18 | ||
18 | all: default tests | 19 | all: default tests |
19 | 20 | ||
21 | install: libbu++.a tools | ||
22 | install -d ${PREFIX}/{include/bu/compat,lib,bin} | ||
23 | install -m u=rw,go=r $(filter-out bu/compat/%,${HEADERS}) ${PREFIX}/include/bu | ||
24 | install -m u=rw,go=r $(filter bu/compat/%,${HEADERS}) ${PREFIX}/include/bu/compat | ||
25 | install -m u=rw,go=r libbu++.a ${PREFIX}/lib | ||
26 | install ${TOOLS} ${PREFIX}/bin | ||
27 | |||
20 | tests: ${UNITS} ${TESTS} | 28 | tests: ${UNITS} ${TESTS} |
21 | 29 | ||
22 | clean: | 30 | clean: |
@@ -49,7 +57,7 @@ src/autoconfig.h src/version.h: autoconfig | |||
49 | src/signals.h: pregen/signals.h | 57 | src/signals.h: pregen/signals.h |
50 | cp $< $@ | 58 | cp $< $@ |
51 | 59 | ||
52 | headers: ${HEADERS} | 60 | headers: bu ${HEADERS} |
53 | 61 | ||
54 | tools: ${TOOLS} | 62 | tools: ${TOOLS} |
55 | 63 | ||
@@ -93,6 +101,6 @@ tests/lzma: | |||
93 | tests/threadid: | 101 | tests/threadid: |
94 | g++ -ggdb -W -Wall -I. -L. $< -o $@ -lbu++ -lpthread | 102 | g++ -ggdb -W -Wall -I. -L. $< -o $@ -lbu++ -lpthread |
95 | 103 | ||
96 | libbu++.a: ${HEADERS} ${OBJECTS} | 104 | libbu++.a: bu ${HEADERS} ${OBJECTS} |
97 | ar -r libbu++.a ${OBJECTS} | 105 | ar -r libbu++.a ${OBJECTS} |
98 | 106 | ||