Facility for two types of depend. tail-type (1) of include-type (2).
[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
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 #$(TPROG): $(TPROG).o $(LIB) 
16 #       $(CC) -o $(TPROG) $(TPROG).o $(LIB)
17
18 $(LIB): $(PO)
19         rm -f $(LIB)
20         ar qc $(LIB) $(PO)
21         ranlib $(LIB)
22
23 .c.o:
24         $(CC) -c $(DEFS) $(CFLAGS) $<
25
26 clean:
27         rm -f *.[oa] $(TPROG) core mon.out gmon.out errlist isam-test
28
29 depend: depend2
30
31 depend1:
32         mv Makefile Makefile.tmp
33         sed '/^#Depend/q' <Makefile.tmp >Makefile
34         $(CPP) $(INCLUDE) -M *.c >>Makefile
35         -rm Makefile.tmp
36
37 depend2:
38         $(CPP) $(INCLUDE) -M *.c >.depend       
39
40 ifeq (.depend,$(wildcard .depend))
41 include .depend
42 endif
43
44 #Depend --- DOT NOT DELETE THIS LINE