477739c2fc5cebbc8ee6b4a4979be1322b06f5e2
[idzebra-moved-to-github.git] / util / Makefile
1 # Copyright (C) 1994, Index Data I/S 
2 # All rights reserved.
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.14 1994-09-22 10:45:19 adam Exp $
5
6 SHELL=/bin/sh
7 INCLUDE=-I../include
8 TPROG=opt-test
9 CFLAGS=-g -Wall -pedantic
10 DEFS=$(INCLUDE)
11 LIB=../lib/util.a
12 PO = options.o xmalloc.o log.o res.o alexpath.o common.o
13 CPP=cc -E
14
15 all: $(LIB)
16
17 opt-test: opt-test.o $(LIB) 
18         $(CC) -o opt-test opt-test.o $(LIB)
19
20 res-test: res-test.o $(LIB)
21         $(CC) -o res-test res-test.o $(LIB)
22
23 $(LIB): $(PO)
24         rm -f $(LIB)
25         ar qc $(LIB) $(PO)
26         ranlib $(LIB)
27
28 .c.o:
29         $(CC) -c $(DEFS) $(CFLAGS) $<
30
31 clean:
32         rm -f *.[oa] opt-test res-test core mon.out gmon.out errlist
33
34 depend: depend2
35
36 depend1:
37         mv Makefile Makefile.tmp
38         sed '/^#Depend/q' <Makefile.tmp >Makefile
39         $(CPP) $(INCLUDE) -M *.c >>Makefile
40         -rm Makefile.tmp
41
42 depend2:
43         $(CPP) $(INCLUDE) -M *.c >.depend       
44
45 ifeq (.depend,$(wildcard .depend))
46 include .depend
47 endif
48
49 #Depend --- DOT NOT DELETE THIS LINE