-
SHELL=/bin/sh
INCLUDE=-I../include
TPROG=btest
-CFLAGS=-g -Wall
+CFLAGS=-g -Wall -pedantic
DEFS=$(INCLUDE)
LIB=../lib/bfile.a
-PO = open.o close.o xmalloc.o rdwr.o
+PO = bfile.o mfile.o
CPP=cc -E
all: $(LIB)
$(CC) -c $(DEFS) $(CFLAGS) $<
clean:
- rm -f *.[oa] $(TPROG) core mon.out gmon.out
+ rm -f *.[oa] $(TPROG) core mon.out gmon.out errlist
+
+depend: depend2
-dep depend:
- $(CPP) $(INCLUDE) -M *.c >.depend
+depend1:
+ mv Makefile Makefile.tmp
+ sed '/^#Depend/q' <Makefile.tmp >Makefile
+ $(CPP) $(INCLUDE) -M *.c >>Makefile
+ -rm Makefile.tmp
-#ifeq (.depend,$(wildcard .depend))
+depend2:
+ $(CPP) $(INCLUDE) -M *.c >.depend
+
+ifeq (.depend,$(wildcard .depend))
include .depend
-#endif
+endif
+
+#Depend --- DOT NOT DELETE THIS LINE