-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
96 lines (69 loc) · 2.59 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
LDFLAGS+= -s
CFLAGS+= -Wall -W -O2 -fPIC `pkg-config --cflags lua` \
-std=c99 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
CC = gcc
SOFLAGS = -shared -pedantic
INSTALL = install
INSTALL_DIR = $(INSTALL) -dm755
INSTALL_DATA = $(INSTALL) -Dm644
INSTALL_PROGRAM = $(INSTALL) -Dm755
prefix = /usr
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
sharedir = $(prefix)/share/lua/5.1
libdir = $(prefix)/lib/lua/5.1
mandir = $(prefix)/share/man
man8dir = $(mandir)/man8
zshcompdir = $(prefix)/share/zsh/site-functions
bashcompdir = /etc/bash_completion.d
manext = .8
lualpm_objects = lualpm/callback.o lualpm/db.o lualpm/delta.o \
lualpm/dep.o lualpm/group.o lualpm/option.o lualpm/package.o \
lualpm/sync.o lualpm/trans.o lualpm/types.o lualpm/lualpm.o
all: clyde lualpm
.PHONY: all lualpm clyde install install_lualpm install_clyde \
clean uninstall uninstall_lualpm uninstall_clyde doc
lualpm/callback.o: lualpm/lualpm.h
lualpm/db.o: lualpm/types.h
lualpm/delta.o: lualpm/types.h
lualpm/dep.o: lualpm/types.h
lualpm/group.o: lualpm/types.h
lualpm/package.o: lualpm/types.h
lualpm/trans.o: lualpm/types.h lualpm/lualpm.h
lualpm/types.o: lualpm/types.h
lualpm.so: $(lualpm_objects)
$(CC) $(CFLAGS) -lalpm -llua $(SOFLAGS) $(LDFLAGS) -o $@ $^
lualpm: lualpm.so
clydelib/signal.so: clydelib/signal.c
$(CC) $(CFLAGS) -llua $(SOFLAGS) $(LDFLAGS) -o $@ $^
clydelib/utilcore.so: clydelib/utilcore.c
$(CC) $(CFLAGS) -llua $(SOFLAGS) $(LDFLAGS) -o $@ $^
doc: man/clyde.8
man/clyde.8: man/clyde.ronn
ronn man/clyde.ronn
clyde: clydelib/signal.so clydelib/utilcore.so
install: install_lualpm install_clyde
install_lualpm: lualpm.so
$(INSTALL_PROGRAM) lualpm.so $(DESTDIR)$(libdir)/lualpm.so
install_clyde: clyde
$(INSTALL_PROGRAM) clyde $(DESTDIR)$(bindir)/clyde
$(INSTALL_DIR) $(DESTDIR)$(sharedir)/clydelib
$(INSTALL_PROGRAM) clydelib/utilcore.so \
$(DESTDIR)$(libdir)/clydelib/utilcore.so
$(INSTALL_PROGRAM) clydelib/signal.so \
$(DESTDIR)$(libdir)/clydelib/signal.so
$(INSTALL_DATA) clydelib/*.lua $(DESTDIR)$(sharedir)/clydelib/
$(INSTALL_DATA) man/clyde$(manext) $(DESTDIR)$(man8dir)/clyde$(manext)
$(INSTALL_DATA) extras/_clydezsh $(DESTDIR)$(zshcompdir)/_clyde
$(INSTALL_DATA) extras/clydebash $(DESTDIR)$(bashcompdir)/clyde
clean:
-rm -f *.so clydelib/*.so lualpm/*.o
uninstall_lualpm:
rm -f $(DESTDIR)$(libdir)/lualpm.so
uninstall_clyde:
rm -Rf $(DESTDIR)$(sharedir)/clydelib
rm -Rf $(DESTDIR)$(libdir)/clydelib
rm -f $(DESTDIR)$(bindir)/clyde $(DESTDIR)$(man8dir)/clyde$(manext)
rm -f $(DESTDIR)$(zshcompdir)/_clyde
rm -f $(DESTDIR)$(bashcompdir)/clyde
uninstall: uninstall_lualpm uninstall_clyde