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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
include Make.$(systype)
CFLAGS=$(XCFLAGS) -I.
LIBS=$(XLIBS) libtra.a libzlib/libzlib.a libbio/libbio.a libc/libc.a
LDFLAGS=$(LIBS) $(LIBS) $(XLDFLAGS)
BINARIES=\
minisync\
stdmerge\
stdsplit\
tradump\
trafixdb\
tramkdb\
trascan\
trasrv
MISCBIN=\
mstress\
testdb\
testlabel\
testmap\
testsrv\
teststore\
thrstdmerge\
tprimes
all: lib $(BINARIES)
misc: $(MISCBIN)
lib:
@( cd lib`echo $(systype) | tr '[A-Z]' '[a-z]'` && make ) || exit 1
@( cd libbio && make ) || exit 1
@( cd libc && make ) || exit 1
@( cd libunix && make ) || exit 1
@( cd libzlib && make ) || exit 1
clean:
rm -f *.o *.a
rm -f $(BINARIES)
rm -f $(MISCBIN)
nuke: clean
rm -f */*.o */*.a
OFILES=\
avl.o\
banner.o\
clist.o\
clnt.o\
copythread.o\
dat.o\
db.o\
fdbuf.o\
hash.o\
list.o\
ignore.o\
path.o\
queue.o\
repl.o\
rpc.o\
sha1.o\
srv.o\
stat.o\
storage.o\
sync.o\
time.o\
util.o\
work.o
libtra.a: $(OFILES)
ar rvu libtra.a $(OFILES)
$(RANLIB) libtra.a
test: tramkdb minisync trasrv tradump
TRASRV=./trasrv export TRASRV
TRADUMP=./tradump export TRADUMP
TRAMKDB=./tramkdb export TRAMKDB
SYNC=./minisync export SYNC
TRATMP=./tmp export TRATMP
rc ../testfn.rc ../test/[0-9]*
test.%: tramkdb textui trasrv tradump
TRASRV=./trasrv
TRADUMP=./tradump
TRAMKDB=./tramkdb
SYNC=./testui
TRATMP=./tmp
rc ../testfn.rc ../test/$*
install: $(BINARIES)
cp $(BINARIES) $(HOME)/bin/`uname`/`uname -m`
install-sys: $(BINARIES)
cp $(BINARIES) /usr/local/bin
cp tra.man /usr/local/man/man1/tra.1
cp tra-aux.man /usr/local/man/man1/tra-aux.1
install-wkj: $(BINARIES)
cp tra.man $(HOME)/etc/man/man1/tra.1
cp tra-aux.man $(HOME)/etc/man/man1/tra-aux.1
cp $(BINARIES) $(HOME)/bin/$$systype/$$objtype/tra
DESTDIR=
install-debian: $(BINARIES)
install --preserve-timestamps $(BINARIES) $(DESTDIR)/usr/bin
# how i wish we could write general rules.
%.o: tra.h os.h copythread.h storage.h avl.h
copythread.o: copythread.c
$(CC) $(ARCHFLAGS) $(CFLAGS) -c copythread.c -o copythread.o
minisync: minisync.o $(LIBS)
$(CC) -o $@ minisync.o $(LDFLAGS)
stdmerge: stdmerge.o $(LIBS)
$(CC) -o $@ stdmerge.o
stdsplit: stdsplit.o $(LIBS)
$(CC) -o $@ stdsplit.o $(LDFLAGS)
mstress: mstress.o $(LIBS)
$(CC) -o $@ mstress.o $(LDFLAGS)
testdb: testdb.o $(LIBS)
$(CC) -o $@ testdb.o $(LDFLAGS)
testlabel: testlabel.o $(LIBS)
$(CC) -o $@ testlabel.o $(LDFLAGS)
testmap: testmap.o $(LIBS)
$(CC) -o $@ testmap.o $(LDFLAGS)
testsrv: testsrv.o $(LIBS)
$(CC) -o $@ testsrv.o $(LDFLAGS)
teststore: teststore.o $(LIBS)
$(CC) -o $@ teststore.o $(LDFLAGS)
tradump: tradump.o noclist.o $(LIBS)
$(CC) -o $@ tradump.o $(LDFLAGS)
trafixdb: trafixdb.o noclist.o $(LIBS)
$(CC) -o $@ trafixdb.o $(LDFLAGS)
tramkdb: tramkdb.o $(LIBS)
$(CC) -o $@ tramkdb.o $(LDFLAGS)
trascan: trascan.o $(LIBS)
$(CC) -o $@ trascan.o $(LDFLAGS)
trasrv: trasrv.o $(LIBS)
$(CC) -o $@ trasrv.o $(LDFLAGS)
thrstdmerge: thrstdmerge.o $(LIBS)
$(CC) -o $@ thrstdmerge.o $(LDFLAGS)
tprimes: tprimes.o $(LIBS)
$(CC) -o $@ tprimes.o $(LDFLAGS)
|