summaryrefslogtreecommitdiff
path: root/libraries/crossguid/Makefile.crossguid
blob: a9e10b8ee3accbf68e17664010561eba190bc814 (plain)
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
override CXXFLAGS += -std=c++11 -DGUID_LIBUUID -fPIC
override LDFLAGS += -luuid
MAJOR := 0
MINOR := 0
VERSION := $(MAJOR).$(MINOR)
NAME = crossguid

INCLUDEDIR = /usr/include
LIBDIR = /usr/lib

LINK.o = $(LINK.cc)

SRC = $(wildcard *.cpp)
OBJ = $(SRC:.cpp=.o)
LIB = lib$(NAME).so.$(VERSION)

$(LIB): guid.o
	$(CXX) $(LDFLAGS) -shared -Wl,-soname,lib$(NAME).so.$(MAJOR) $^ -o $@

test: $(OBJ)

install: guid.h $(LIB)
	install -dm 0755 $(DESTDIR)$(INCLUDEDIR)
	install -pm 0644 guid.h $(DESTDIR)$(INCLUDEDIR)
	install -dm 0755 $(DESTDIR)$(LIBDIR)
	install -pm 0755 $(LIB) $(DESTDIR)$(LIBDIR)
	ln -sf $(LIB) $(DESTDIR)$(LIBDIR)/lib$(NAME).so
	ln -sf $(LIB) $(DESTDIR)$(LIBDIR)/lib$(NAME).so.$(MAJOR)

clean:
	$(RM) $(OBJ) $(LIB) test

.PHONY: run-test install clean