home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume30 / oraperl-v2 / part04 / Makefile < prev    next >
Encoding:
Makefile  |  1992-07-06  |  4.0 KB  |  146 lines

  1. # Makefile for Oraperl and Coraperl
  2.  
  3. # Change these to your ORACLE installation directory and Perl source directory
  4. #
  5. ORACLE_HOME    = /usr/soft/oracle
  6. SRC        = /usr/soft/public/perl
  7.  
  8. # Oracle Definitions, copied from $(ORACLE_HOME)/c/demo/proc.mk
  9. # ALL_ORA_LIBS is the only entry that the Makefile actually uses;
  10. # change it to whatever you need to link Pro*C programs
  11. #
  12. OTHERLIBS    = `cat $(ORACLE_HOME)/rdbms/lib/sysliblist`
  13. CLIBS        = $(OTHERLIBS)
  14. OCILIB        = $(ORACLE_HOME)/rdbms/lib/libocic.a
  15. NETLIBS        = $(ORACLE_HOME)/rdbms/lib/osntab.o \
  16.             $(ORACLE_HOME)/rdbms/lib/libsqlnet.a 
  17. ORALIBS        = $(ORACLE_HOME)/rdbms/lib/libora.a
  18.  
  19. ALL_ORA_LIBS    = $(CLIBS) $(OCILIB) $(NETLIBS) $(ORALIBS)
  20.  
  21. # Perl Definitions, taken from $SRC/usub/Makefile
  22. # Don't include the curses libraries here - they go in CURSELIB
  23. #
  24. GLOBINCS    = 
  25. LOCINCS        = 
  26. LIBS        = `. $(SRC)/config.sh; echo $$libs`
  27.  
  28. # Oraperl Definitions
  29.  
  30. # Set DEBUG to -DDEBUGGING, -DPERL_DEBUGGING or leave blank (see orafns.h)
  31. # If it is not blank, uncomment the definition of DBUG_O
  32. #
  33. DEBUG        = -DPERL_DEBUGGING
  34. DBUG_O        = dbug/dbug.o
  35.  
  36. # Curses libraries, only required if you want to build Coraperl
  37. # You may also need -ltermlib or -ltermcap
  38. #
  39. CURSELIB    = -lcurses
  40.  
  41. # Row cache size for SELECT statements.
  42. # If you want to change the default, uncomment this and set the value you want
  43. #
  44. #CACHE        = -DCACHE_SIZE=5
  45.  
  46. # Bind variable padding.
  47. # If you want binding an empty string to provoke an error, uncomment this line.
  48. #
  49. #BIND        = -DNO_BIND_PADDING
  50.  
  51. # Some system-specific things
  52. #
  53. # If your system library does not include strtoul, uncomment the next line
  54. STRTOUL    = strtoul.o
  55. #
  56. # If you are using Perl v3 instead of v4, uncomment the next line
  57. # STR_2MORTAL    = -Dstr_2mortal=str_2static
  58.  
  59. # Database, username and password to use for testing
  60. #
  61. TESTDATA    = t scott tiger
  62.  
  63.  
  64. #
  65. #    Leave these blank lines so that patches to what is below
  66. #    won't be upset by your changes to the setups above.
  67. #
  68.  
  69.  
  70. # From here on, you shouldn't need to change anything. If you do, let me know.
  71.  
  72. SRCS        = oracle.mus orafns.c getcursor.c colons.c usersub.c \
  73.           debug.c strtoul.c
  74. OBJS        = oracle.o orafns.o getcursor.o colons.o debug.o $(STRTOUL)
  75. OOBJS        = $(OBJS) usersub.o $(DBUG_O)
  76. COBJS        = $(OBJS) cusersub.o $(DBUG_O)
  77. HDRS        = patchlevel.h orafns.h
  78. DEFS        = $(STRTOL) $(PUTENV) $(STR_2MORTAL) $(DEBUG) $(CACHE) $(BIND)
  79.  
  80. CFLAGS        = -Idbug -I$(SRC) $(GLOBINCS) $(LOCINCS) $(DEFS)
  81.  
  82. oraperl: $(SRC)/uperl.o $(OOBJS)
  83.     $(CC) -o oraperl $(SRC)/uperl.o $(OOBJS)            \
  84.           -lm $(ALL_ORA_LIBS) $(LIBS)
  85.  
  86. coraperl: $(SRC)/uperl.o $(COBJS) $(SRC)/usub/curses.o
  87.     $(CC) -o coraperl $(SRC)/uperl.o $(COBJS) $(SRC)/usub/curses.o    \
  88.           -lm $(ALL_ORA_LIBS) $(LIBS) $(CURSELIB)
  89.  
  90. all:    oraperl coraperl
  91.  
  92. test:    oraperl
  93.     @oraperl -e '&ora_version'
  94.     @(cd testdir ;                                  \
  95.       rm -f My-Results ;                              \
  96.       echo "Testing oraperl, please wait ..." ;                  \
  97.       for i in *.pl    ; do ../oraperl $$i $(TESTDATA) ; done > My-Results ; \
  98.       if cmp -s Standard-Results My-Results ;                  \
  99.       then echo "Test successful" ;                          \
  100.       else echo "Test failed - compare My-Results with Standard-Results" ;\
  101.       fi; echo)
  102.  
  103. # We use oraperl although perl would suffice, because we know where it is!
  104.  
  105. install:    oraperl install.pl
  106.     @./oraperl ./install.pl ${SRC}
  107.  
  108. cusersub.c:    usersub.c
  109.     @rm -f cusersub.c
  110.     ln usersub.c cusersub.c
  111.  
  112. cusersub.o:    cusersub.c
  113.     $(CC) -c $(CFLAGS) -DCURSES cusersub.c
  114.  
  115. oracle.c: $(SRC)/usub/mus oracle.mus
  116.     $(SRC)/usub/mus oracle.mus >oracle.c
  117.  
  118. $(OOBJS) $(COBJS):    $(HDRS)
  119.  
  120. dbug/dbug.o:
  121.     (cd dbug ; $(MAKE) dbug.o)
  122.     @echo "    (back to main directory)"
  123.  
  124. clean:
  125.     (cd dbug ; $(MAKE) clean)
  126.     @echo "    (back to main directory)"
  127.     rm -f nohup.out *.o oracle.c cusersub.c
  128.     rm -f testdir/My-Results listing tags core
  129.  
  130. realclean clobber:    clean
  131.     (cd dbug ; $(MAKE) clobber)
  132.     (cd doc ; $(MAKE) clobber)
  133.     @echo "    (back to main directory)"
  134.     rm -f oraperl coraperl
  135.  
  136. listing:
  137.     pr -fn Makefile $(HDRS) $(SRCS) >listing
  138.  
  139. docs:
  140.     (cd doc ; $(MAKE) docs)
  141.     @echo "    (back to main directory)"
  142.  
  143. shar:    clean
  144.     shar -n oraperl-v2 -a -s kstock@encore.com -F -o :Part -l 64    \
  145.         Readme [C-Q]* Row* [S-z]*
  146.