Modified makefile to use common lib
authorSebastian Hammer <quinn@indexdata.com>
Tue, 14 Mar 1995 10:27:34 +0000 (10:27 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Tue, 14 Mar 1995 10:27:34 +0000 (10:27 +0000)
Beginning to add memory management to odr

odr/Makefile
odr/odr_mem.c [new file with mode: 0644]

index deb99e4..522f7e2 100644 (file)
@@ -1,23 +1,26 @@
 # Copyright (C) 1994, Index Data I/S 
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.6 1995-03-10 11:44:40 quinn Exp $
+# $Id: Makefile,v 1.7 1995-03-14 10:27:34 quinn Exp $
 
 SHELL=/bin/sh
 INCLUDE=-I../include -I.
-CFLAGS= -g -Wall -pedantic -ansi -DODR_DEBUG
+LIBDIR=../../lib
+LIBINCLUDE=-L$(LIBDIR)
+#CFLAGS= -g -Wall -pedantic -ansi -DODR_DEBUG
 DEFS=$(INCLUDE)
-LIB=odr.a
+LIB=$(LIBDIR)/libodr.a
+LIBS=-lodr
 PO = odr_bool.o ber_bool.o ber_len.o ber_tag.o odr_util.o odr_null.o \
        ber_null.o odr_int.o ber_int.o odr_tag.o odr_cons.o odr_seq.o\
        odr_oct.o ber_oct.o odr_bit.o ber_bit.o odr_oid.o ber_oid.o odr_use.o \
        odr_choice.o odr_any.o ber_any.o odr.o
 CPP=cc -E
 
-all: $(LIB)
+all: $(LIBDIR) $(LIB)
 
 test: test.o $(LIB)
-       $(CC) $(CFLAGS) $(INCLUDE) -o test test.o $(LIB)
+       $(CC) $(CFLAGS) $(LIBINCLUDE) -o test test.o $(LIBS)
 
 alll:
 
@@ -26,6 +29,9 @@ $(LIB): $(PO)
        ar qc $(LIB) $(PO)
        ranlib $(LIB)
 
+$(LIBDIR):
+       mkdir $(LIBDIR)
+
 .c.o:
        $(CC) -c $(DEFS) $(CFLAGS) $<
 
diff --git a/odr/odr_mem.c b/odr/odr_mem.c
new file mode 100644 (file)
index 0000000..4d6bf6d
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 1994, Index Data I/S 
+ * All rights reserved.
+ * Sebastian Hammer, Adam Dickmeiss
+ *
+ * $Log: odr_mem.c,v $
+ * Revision 1.1  1995-03-14 10:27:40  quinn
+ * Modified makefile to use common lib
+ * Beginning to add memory management to odr
+ *
+ *
+ */
+
+#include <stdlib.h>
+
+#include <odr.h>
+
+char *odr_malloc(ODR o, int size)
+{
+    return malloc(size); /* REPLACE WITH NIBBLE MALLOC!! */
+}