-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
74 lines (57 loc) · 2.06 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#***************************************************************************
#*
#* Copyright Dstl 2012
#*
#* Module: Makefile.template
#*
#* Original Author: Matt Nottingham
#*
#* Description: Makefile for the image library library
#*
#***************************************************************************
CC = g++
SRC = MVector_cApi.cpp
INCLUDE = MVector.h MVector_version.h
CFLAGS = -O2 -Wall -c -m64
OBJ = $(patsubst %.cpp, %.o, $(SRC))
VERSION = CONFIGVERSION
CFLAGS+=-DVERSION="\"$(VERSION)\""
uname := $(shell uname)
installedversion := $(shell INSTALL_DIR/bin/MVector-config --version)
lib: libMVector.a
libMVector.a: $(OBJ) $(INCLUDE)
@echo Making library libMVector.a
ar -r libMVector.a $(OBJ)
install: libMVector.a
ifeq ($(installedversion), $(VERSION))
@echo "*** "
@echo "*** ERROR: This version is already installed."
@echo "*** Have you updated MVector_version.h?"
@echo "*** "
endif
mkdir -p INSTALL_DIR/lib
cp -i libMVector.a INSTALL_DIR/lib/libMVector-$(VERSION).a
rm -f INSTALL_DIR/lib/libMVector.a
ln -s INSTALL_DIR/lib/libMVector-$(VERSION).a INSTALL_DIR/lib/libMVector.a
mkdir -p INSTALL_DIR/include/MVector-$(VERSION)
cp -i $(INCLUDE) INSTALL_DIR/include/MVector-$(VERSION)
rm -f INSTALL_DIR/include/MVector
ln -s INSTALL_DIR/include/MVector-$(VERSION) INSTALL_DIR/include/MVector
rm -f MVector-config
@echo >MVector-config "#!/bin/sh"
@echo >>MVector-config "CONFIG_LIBS=\"-LINSTALL_DIR/lib -lMVector -lstdc++ \""
@echo >>MVector-config "CONFIG_CFLAGS=\"-IINSTALL_DIR/include/MVector \""
@echo >>MVector-config "CONFIG_VERSION=\"$(VERSION)\""
@echo >>MVector-config "CONFIG_PREFIX=\"INSTALL_DIR\""
cat >>MVector-config MVector-config.in
cp -i MVector-config INSTALL_DIR/bin
chmod +x INSTALL_DIR/bin/MVector-config
%.o: %.cpp $(INCLUDE)
$(CC) $< $(CFLAGS) -o $@
clean:
rm -f *.o libMVector.a
test:
@echo "Building Test Harness...."
gcc -Wall -m64 cVectorTests/cVectorTests.c `MVector-config --cflags` `MVector-config --libs` -o cVectorTests/cVectorTests
@echo "Running Test Harness..."
cVectorTests/cVectorTests