-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
82 lines (57 loc) · 1.79 KB
/
Makefile
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
72
73
74
75
76
77
78
79
80
81
82
## Makefile for libpidontrol
## Edit thise variables to configure installation path
# root to install to for `make install'
PREFIX := /usr/local
# if you use stow, root of your stow package directory
STOWBASE := /usr/local/stow
# if you use stow, a name for this stow package
## Mabe you care about these
CC := gcc
CXXFLAGS := -g -fPIC -I./include -Wall
OCXXFLAGS := -O3 -funroll-loops -I./include
## You probably don't care aboute these
VERSION := 0.0.1
PROJECT := libpidcontrol
STOWDIR := $(PROJECT)-$(VERSION)
STOWPREFIX := $(STOWBASE)/$(STOWDIR)
DISTPATH := $(HOME)/prism/tarballs
DOXPATH := $(HOME)/prism/public_html/dox
PLATFORM := $(shell uname -s)
## OS X uses a different library extension, play nice
ifeq ($(PLATFORM),Darwin)
PRODUCT := $(PROJECT).dylib
LDFLAGS := -lc
else
PRODUCT := $(PROJECT).so
endif
HEADERS := $(addprefix include/pidcontrol/,pidcontrol.h)
.PHONY: doc default clean stow
default: $(PRODUCT)
.c.o:
$(CC) $(CXXFLAGS) -c $<
pid_test: pid_test.c
$(CC) $(CXXFLAGS) -o $@ $< -lpidcontrol
$(PRODUCT): pidcontrol.o $(HEADERS)
$(CC) -shared -Wl,-soname,$@ -o $@ $< $(LDFLAGS)
clean:
rm -fv *.o *.so *.dylib pid_test
distclean: clean
rm -rf doc
doc:
doxygen
docul: doc
cp -Tr doc/html $(DOXPATH)/$(PROJECT)
dist: distclean
cd .. && \
tar --exclude=.svn --lzma -cvf $(DISTPATH)/$(PROJECT)-$(VERSION).tar.lzma $(PROJECT)
stow: $(PRODUCT)
mkdir -p $(STOWPREFIX)/include/ssdmu
mkdir -p $(STOWPREFIX)/lib/
install --mode 755 $(PRODUCT) $(STOWPREFIX)/lib
install --mode 644 include/pidcontrol/*.h $(STOWPREFIX)/include/pidcontrol
cd $(STOWBASE) && stow $(STOWDIR)
install: $(PRODUCT)
mkdir -p $(PREFIX)/include/pidcontrol
mkdir -p $(PREFIX)/lib/
install --mode 755 $(PRODUCT) $(PREFIX)/lib
install --mode 644 include/pidcontrol/*.h $(PREFIX)/include/pidcontrol