-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
119 lines (88 loc) · 2.33 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#OPT := -O2
# Can I put this here?
export LD_LIBRARY_PATH := .
LIBNAME = libcworks
VERSION = 0.0.12
BASEVERSION = 0
LIB=$(LIBNAME).so
VLIB=$(LIB).$(VERSION)
BLIB=$(LIB).$(BASEVERSION)
LINKDIR=/usr/local/lib
ROOTLINKDIR=/usr/lib
WINLINKDIR ?= D:\Lib
all: listworks sortworks stringworks tableworks fileworks intworks
gcc -shared -o $(VLIB) *.o
-ln -sf $(VLIB) $(LIB)
listworks: arrlist.o nodelist.o bintree.o arrqueue.o
sortworks: compfunc.o search.o mergesort.o
stringworks: stringbuilder.o boyermoore.o
tableworks: table.o
fileworks: filefuncs.o
intworks: ranges.o
# Well, these are sorted alphabetically. In need of better organization
arrlist.o:
gcc -c $(OPT) -fpic arrlist.c
arrqueue.o:
gcc -c $(OPT) -fpic arrqueue.c
bintree.o:
gcc -c $(OPT) -fpic bintree.c
boyermoore.o:
gcc -c $(OPT) -fpic boyermoore.c
compfunc.o:
gcc -c $(OPT) -fpic compfunc.c
filefuncs.o:
gcc -c $(OPT) -fpic filefuncs.c
mergesort.o:
gcc -c $(OPT) -fpic mergesort.c
nodelist.o:
gcc -c $(OPT) -fpic nodelist.c
ranges.o:
gcc -c $(OPT) -fpic ranges.c
search.o:
gcc -c $(OPT) -fpic search.c
stringbuilder.o:
gcc -c $(OPT) -fpic stringbuilder.c
table.o:
gcc -c $(OPT) -fpic table.c
clean:
-rm *.o
-rm $(LIB)
-rm $(VLIB)
install:
# (must be root for this one, apparently)
cp $(VLIB) $(LINKDIR)
ln -sf $(VLIB) $(LINKDIR)/$(LIB)
ln -sf $(VLIB) $(LINKDIR)/$(BLIB)
ln -sf $(LINKDIR)/$(VLIB) $(ROOTLINKDIR)/$(VLIB)
ln -sf $(LINKDIR)/$(LIB) $(ROOTLINKDIR)/$(LIB)
ln -sf $(LINKDIR)/$(BLIB) $(ROOTLINKDIR)/$(BLIB)
-rm -r /usr/local/include/cworks
mkdir /usr/local/include/cworks
cp *.h /usr/local/include/cworks/
uninstall:
# (this one, too)
-rm $(LINKDIR)/$(VLIB)
-rm $(LINKDIR)/$(LIB)
-rm $(LINKDIR)/$(BLIB)
-rm $(ROOTLINKDIR)/$(VLIB)
-rm $(ROOTLINKDIR)/$(LIB)
-rm $(ROOTLINKDIR)/$(BLIB)
-rm -r /usr/local/include/cworks
wclean:
-del *.o
-del $(LIB)
-del $(VLIB)
winstall:
copy /Y $(VLIB) $(WINLINKDIR)\cworks\$(VLIB)
copy /Y $(VLIB) $(WINLINKDIR)\cworks\$(LIBNAME).dll
copy /Y $(VLIB) $(WINLINKDIR)\$(LIBNAME).dll
copy /Y $(VLIB) C:\Windows\System32\\
copy /Y $(VLIB) C:\Windows\SysWOW64\\
copy /Y *.h $(WINLINKDIR)\cworks\\
wuninstall:
del $(WINLINKDIR)\cworks\$(VLIB)
del $(WINLINKDIR)\cworks\$(LIBNAME).dll
del $(WINLINKDIR)\$(LIBNAME).dll
del C:\Windows\System32\$(VLIB)
del C:\Windows\SysWOW64\$(VLIB)
del $(WINLINKDIR)\cworks\*.h