Most of the functionality in place.
[idzebra-moved-to-github.git] / isam / Makefile
1 SHELL=/bin/sh
2 INCLUDE=-I../include
3 CFLAGS=-g -Wall -pedantic
4 DEFS=$(INCLUDE)
5 LIB=../lib/isam.a
6 PO = isam.o isutil.o rootblk.o memory.o physical.o
7 CPP=cc -E
8
9 all: $(LIB)
10
11 isam-test: isam-test.c $(LIB)
12         $(CC) -g -o isam-test -I../include isam-test.c \
13         ../lib/isam.a ../lib/bfile.a ../lib/util.a
14
15 issh: issh.c $(LIB)
16         $(CC) -g -o issh -I../include issh.c \
17         ../lib/isam.a ../lib/bfile.a ../lib/util.a
18
19 #$(TPROG): $(TPROG).o $(LIB) 
20 #       $(CC) -o $(TPROG) $(TPROG).o $(LIB)
21
22 $(LIB): $(PO)
23         rm -f $(LIB)
24         ar qc $(LIB) $(PO)
25         ranlib $(LIB)
26
27 .c.o:
28         $(CC) -c $(DEFS) $(CFLAGS) $<
29
30 clean:
31         rm -f *.[oa] $(TPROG) core mon.out gmon.out errlist isam-test
32
33 depend: depend2
34
35 depend1:
36         mv Makefile Makefile.tmp
37         sed '/^#Depend/q' <Makefile.tmp >Makefile
38         $(CPP) $(INCLUDE) -M *.c >>Makefile
39         -rm Makefile.tmp
40
41 depend2:
42         $(CPP) $(INCLUDE) -M *.c >.depend       
43
44 ifeq (.depend,$(wildcard .depend))
45 include .depend
46 endif
47
48 #Depend --- DOT NOT DELETE THIS LINE