Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # @(#)Makefile 8.9 (Berkeley) 7/14/94
  2. LIBDB= libdb1.a
  3. ARCH=$(shell uname -m)
  4. ifeq ($(ARCH),alpha)
  5. SOVER=2.1
  6. else
  7. SOVER=2
  8. endif
  9. ifeq ($(OSARCH),Darwin)
  10. OSARCH_DEFINE+=-D__Darwin__
  11. endif
  12. LIBDBSO=libdb.so.$(SOVER)
  13. PROG= db_dump185
  14. OBJ1= hash/hash.o hash/hash_bigkey.o hash/hash_buf.o hash/hash_func.o hash/hash_log2.o hash/hash_page.o \
  15. hash/ndbm.o
  16. OBJ2= btree/bt_close.o btree/bt_conv.o btree/bt_debug.o btree/bt_delete.o btree/bt_get.o btree/bt_open.o \
  17. btree/bt_overflow.o btree/bt_page.o btree/bt_put.o btree/bt_search.o btree/bt_seq.o btree/bt_split.o \
  18. btree/bt_utils.o
  19. OBJ3= db/db.o
  20. OBJ4= mpool/mpool.o
  21. OBJ5= recno/rec_close.o recno/rec_delete.o recno/rec_get.o recno/rec_open.o recno/rec_put.o recno/rec_search.o \
  22. recno/rec_seq.o recno/rec_utils.o
  23. MISC=
  24. OBJS= $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(MISC)
  25. SHOBJS= $(patsubst %.o,%.os,$(OBJS))
  26. include $(ASTTOPDIR)/Makefile.rules
  27. all: $(LIBDB) #$(LIBDBSO) $(PROG)
  28. $(LIBDB): $(OBJS)
  29. $(ECHO_PREFIX) echo " [AR] $^ -> $@"
  30. $(CMD_PREFIX) $(AR) cr $@ $^
  31. $(CMD_PREFIX) $(RANLIB) $@
  32. $(LIBDBSO): $(SHOBJS)
  33. $(CC) -Wl,-O1 -Wl,--version-script=libdb.map -Wl,-soname=$(LIBDBSO) -shared -o $@ $^
  34. ln -sf $@ libdb.so
  35. $(PROG): db_dump185.o $(LIBDBSO)
  36. $(CC) -o $@ db_dump185.o -L. -ldb
  37. clean-depend:
  38. clean:
  39. rm -f $(LIBDB) $(LIBDBSO) $(OBJS) $(SHOBJS) */*.s */*.i
  40. _ASTCFLAGS:=-Wall -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude -Ihash -Ibtree -Irecno $(_ASTCFLAGS)
  41. OSTYPE=$(shell uname -s)
  42. ifeq ($(OSTYPE),SunOS)
  43. _ASTCFLAGS+=-I../../include -I../../include/solaris-compat -DSOLARIS
  44. endif
  45. db_dump185.o: db_dump185.c
  46. $(CL) -o $@ $<
  47. x%.o: hash/%.c
  48. $(CL) -Ihash $(OSARCH_DEFINE) -o $@ $<
  49. %.os: hash/%.c
  50. $(CL) -Ihash -fPIC -o $@ $<
  51. x%.o: btree/%.c
  52. $(CL) -Ibtree -o $@ $<
  53. %.os: btree/%.c
  54. $(CL) -Ibtree -fPIC -o $@ $<
  55. x%.o: recno/%.c
  56. $(CL) -Irecno -o $@ $<
  57. %.os: recno/%.c
  58. $(CL) -Irecno -fPIC -o $@ $<