Debian Codegraph @

src/Makefile

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 # use -DGENHT_WANT_INLINE to turn half of the API into static inline functions
2 PREFIX=/usr
3 INCDIR=$(install_root)$(DESTDIR)$(PREFIX)/include/genht
4 LIBDIR=$(install_root)$(DESTDIR)$(PREFIX)/lib
5
6 HOSTCC = $(CC)
7
8 VER_MAJOR=1
9 VER_MINOR=1
10 VER_PATCH=3
11 VER=$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
12
13 CFLAGS=-g $(GENHT_CFLAGS)
14 LDFLAGS=$(GENHT_LDFLAGS)
15
16 BIN=mainsi
17 OBJS=htss.o htsp.o htsi.o htip.o htpp.o htpi.o hash.o siphash24.o
18 LIBSO0=libgenht.so
19 LIBSO=libgenht.so.$(VER)
20 LIBSO1=libgenht.so.$(VER_MAJOR)
21 LIBA=libgenht.a
22
23 all: version.h $(BIN) $(OBJS) $(LIBA) $(LIBSO)
24
25 clean:
26 -rm $(BIN) $(OBJS) $(LIBA) $(LIBSO) genht_std.so genht_std.a version.h ver_edit
27
28 .SUFFIXES:
29 .SUFFIXES: .o .c
30
31 .c.o:
32 $(CC) -o $@ -c -fPIC $< $(CFLAGS)
33
34 mainsi: mainsi.o htsi.o
35 $(CC) -o $@ mainsi.o htsi.o $(LDFLAGS)
36
37 $(LIBSO): $(OBJS)
38 $(CC) $(LDFLAGS) -shared -dynamic -rdynamic -o $@ $(OBJS)
39
40 $(LIBA): $(OBJS)
41 ar rvu $@ $(OBJS)
42 -ar s $@
43 -ranlib $@
44
45 # for compatibility
46 genht_std.so: $(LIBSO)
47 ln -s $(LIBSO) genht_std.so
48
49 # for compatibility
50 genht_std.a: $(LIBA)
51 ln -s $(LIBA) genht_std.a
52
53 version.h: version.h.in ver_edit
54 ./ver_edit $(VER_MAJOR) $(VER_MINOR) $(VER_PATCH) < version.h.in > version.h
55
56 ver_edit: ver_edit.c
57 $(HOSTCC) -o $@ $(CFLAGS) ver_edit.c
58
59 install_:
60 mkdir -p $(INCDIR) $(LIBDIR)
61 $(CP) `pwd`/hash.h $(INCDIR)/hash.h
62 $(CP) `pwd`/siphash24.h $(INCDIR)/siphash24.h
63 $(CP) `pwd`/ht.h $(INCDIR)/ht.h
64 $(CP) `pwd`/ht.c $(INCDIR)/ht.c
65 $(CP) `pwd`/version.h $(INCDIR)/version.h
66 $(CP) `pwd`/ht_inlines.h $(INCDIR)/ht_inlines.h
67 $(CP) `pwd`/ht_utils.h $(INCDIR)/ht_utils.h
68 $(CP) `pwd`/htip.h $(INCDIR)/htip.h
69 $(CP) `pwd`/htpi.h $(INCDIR)/htpi.h
70 $(CP) `pwd`/htsi.h $(INCDIR)/htsi.h
71 $(CP) `pwd`/htsp.h $(INCDIR)/htsp.h
72 $(CP) `pwd`/htss.h $(INCDIR)/htss.h
73 $(CP) `pwd`/htpp.h $(INCDIR)/htpp.h
74 $(CP) `pwd`/$(LIBSO) $(LIBDIR)/$(LIBSO)
75 $(CP) `pwd`/$(LIBA) $(LIBDIR)/$(LIBA)
76
77 uninstall:
78 rm -rf $(INCDIR)
79 rm $(LIBDIR)/$(LIBSO) $(LIBDIR)/$(LIBA) $(LIBDIR)/$(LIBSO1) $(LIBDIR)/$(LIBSO0)
80
81 install:
82 $(MAKE) install_ CP="cp"
83 -@rm $(LIBDIR)/$(LIBSO1) 2>/dev/null
84 ln -s $(LIBSO) $(LIBDIR)/$(LIBSO1)
85 -ln -s $(LIBSO) $(LIBDIR)/$(LIBSO0)
86
87 linstall:
88 $(MAKE) install_ CP="ln -s"
89 -@rm $(LIBDIR)/$(LIBSO1) 2>/dev/null
90 ln -s $(LIBSO) $(LIBDIR)/$(LIBSO1)
91 -ln -s $(LIBSO) $(LIBDIR)/$(LIBSO0)
92
93 test: mainsi
94 @./mainsi > mainsi.out
95 @diff mainsi.ref mainsi.out
96 @echo "*** QC pass ***"