home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume37 / sybperl / part01 / Makefile next >
Makefile  |  1993-05-04  |  3KB  |  110 lines

  1. #    @(#)Makefile    1.13    4/6/93
  2. #
  3.     
  4. CC = gcc
  5. PERLSRC = ..                # where to find uperl.o
  6. SYBINCS = /usr/local/sybase/include    # where to find the sybase .h files
  7. LOCINCS =                # other includes ?
  8. SYBLIBDIR = /usr/local/lib        # Sybase libraries
  9. SYBLIBS = -lsybdb            # db-library
  10.  
  11. # Uncomment this if you are compiling sybperl for Perl version 3.xx
  12.  
  13. # PERL_VERSION = -DVERSION3
  14.  
  15. # The Perl/Sybase savestr() conflict.
  16. # Both Perl and Sybase DB-Library have a function called savestr(),
  17. # and this creates a problem when using functions such as dbcmd().
  18. # There are several ways around this.
  19. # You can:
  20. #
  21. #    - Recompile uperl.o with a -Dsavestr=psvestr (or something similar).
  22. #    - Edit an existing uperl.o and change _savestr to _psvestr.
  23. #
  24. #
  25. # To use the first option, you have to reconfigure & recompile Perl
  26. # manually, and then set compile sybperl with the following line
  27. # uncommented:
  28. # UPERL = $(PERLSRC)/uperl.o
  29. #
  30. # The default is to use the third solution:
  31. UPERL = uperl2.o
  32.  
  33.  
  34. HAS_CALLBACK= -DHAS_CALLBACK        # Remove this if you don't
  35.                     # have Perl 4 patchlevel 18
  36.                     # User defined, perl based
  37.                     # error/message handlers are
  38.                     # not possible without this, however.
  39. OLD_SYBPERL= -DOLD_SYBPERL        # some backward compatibility stuff.
  40.  
  41. #DBLIB42 = -DDBLIB42            # Comment this if your version
  42.                     # of DBlib is older than
  43.                     # version 4.2
  44.  
  45. #SET_VAL = -DUSERVAL_SET_FATAL        # Uncomment this if you wish
  46.                     # to get a fatal error message
  47.                     # if you attempt to set on of
  48.                     # Sybperl's variables from a
  49.                     # script. Normally such
  50.                     # actions are silently ignored.
  51.  
  52. #NULL_UNDEF = -DNULL_IS_UNDEF           # Uncomment this to get
  53.                     # 'undef' values returned by
  54.                     # &dbnextrow when NULL values
  55.                     # are retrieved. Otherwise,
  56.                     # the string 'NULL' is returned.
  57.  
  58. CFLAGS = -O2 -g
  59. CPPFLAGS = -I$(PERLSRC) -I$(LOCINCS) -I$(SYBINCS) $(PERL_VERSION) \
  60.         $(SAVESTR) $(HAS_CALLBACK) $(OLD_SYBPERL) $(DBLIB42) \
  61.         $(SET_VAL)
  62. BINDIR = /usr/local/bin            # where does the executable go
  63. PERLLIB = /usr/local/lib/perl        # where does lib/sybperl.pl
  64.                     # and lib/sybdb.ph go
  65. MANDIR = /usr/local/man            # where do we put the manual page
  66. MANEXT = l
  67.  
  68.  
  69. sybperl: $(UPERL) sybperl.o
  70.     $(CC) $(CFLAGS) -L$(SYBLIBDIR) $(UPERL) sybperl.o $(SYBLIBS) -lm -o sybperl
  71.  
  72. sybperl.o: sybperl.c
  73.     $(CC) -c $(CFLAGS) $(CPPFLAGS) sybperl.c
  74.  
  75. # Create uperl.o IF you wish to use the 3rd way of resolving the
  76. # Perl/Sybase savestr conflict.
  77. $(UPERL): $(PERLSRC)/uperl.o
  78.     cp $(PERLSRC)/uperl.o $(UPERL)
  79.     perl -p -i.bak -e 's/savestr/psvestr/g;' $(UPERL)
  80.     rm -f $(UPERL).bak
  81.  
  82.  
  83. clean:
  84.     rm -f sybperl *.o *~ core
  85.  
  86. install: sybperl
  87.     install -s -m 775 sybperl $(BINDIR)
  88.     cp lib/syb*.p? $(PERLLIB)/perllib.pl
  89.     cp sybperl.1 $(MANDIR)/man$(MANEXT)/sybperl.$(MANEXT)
  90.  
  91. shar:
  92.     rm -f sybperl.shar
  93.     shar.pl README PACKING.LST BUGS CHANGES Makefile sybperl.c \
  94.     sybperl.1 patchlevel.h lib/sybperl.pl lib/sybdb.ph t/sbex.pl \
  95.     eg/sql.pl eg/space.pl eg/capture.pl eg/report.pl \
  96.     eg/dbschema.pl eg/dbtext.pl eg/README >sybperl.shar
  97.  
  98.  
  99. tar:
  100.     rm -f sybperl.tar
  101.     tar cvfB sybperl.tar README PACKING.LST BUGS CHANGES Makefile sybperl.c \
  102.     sybperl.1 patchlevel.h lib/sybperl.pl lib/sybdb.ph t/sbex.pl \
  103.     eg/sql.pl eg/space.pl eg/capture.pl eg/report.pl \
  104.     eg/dbschema.pl eg/dbtext.pl eg/README
  105.  
  106.  
  107.  
  108.  
  109.  
  110.