Back again...
[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 test: test.c $(LIB)
12         $(CC) -g -o test -I../include test.c \
13         ../lib/isam.a ../lib/bfile.a ../lib/util.a
14
15 isam-test: isam-test.c $(LIB)
16         $(CC) -g -o isam-test -I../include isam-test.c \
17         ../lib/isam.a ../lib/bfile.a ../lib/util.a
18
19 issh: issh.c $(LIB)
20         $(CC) -g -o issh -I../include issh.c \
21         ../lib/isam.a ../lib/bfile.a ../lib/util.a
22
23 #$(TPROG): $(TPROG).o $(LIB) 
24 #       $(CC) -o $(TPROG) $(TPROG).o $(LIB)
25
26 $(LIB): $(PO)
27         rm -f $(LIB)
28         ar qc $(LIB) $(PO)
29         ranlib $(LIB)
30
31 .c.o:
32         $(CC) -c $(DEFS) $(CFLAGS) $<
33
34 clean:
35         rm -f *.[oa] $(TPROG) core mon.out gmon.out errlist isam-test issh
36
37 depend: depend2
38
39 depend1:
40         mv Makefile Makefile.tmp
41         sed '/^#Depend/q' <Makefile.tmp >Makefile
42         $(CPP) $(INCLUDE) -M *.c >>Makefile
43         -rm Makefile.tmp
44
45 depend2:
46         $(CPP) $(INCLUDE) -M *.c >.depend       
47
48 ifeq (.depend,$(wildcard .depend))
49 include .depend
50 endif
51
52 #Depend --- DOT NOT DELETE THIS LINE