home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume28 / sybperl / part01 / Makefile < prev    next >
Encoding:
Makefile  |  1992-02-10  |  2.5 KB  |  85 lines

  1. #    @(#)Makefile    1.6    11/25/91
  2. #
  3.     
  4. CC = cc
  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. #    - define BROKEN_DBCMD: this enables some code emulating
  22. #      dbcmd() that I've written.
  23. #    - Recompile uperl.o with a -Dsavestr=psvestr (or something similar).
  24. #    - Edit an existing uperl.o and change _savestr to _psvestr.
  25. #
  26. # To use the first option, uncomment the following definitions for
  27. # SAVESTR and UPERL
  28. # SAVESTR = -DBROKEN_DBCMD
  29. # UPERL = $(PERLSRC)/uperl.o
  30. #
  31. # To use the second option, you have to reconfigure & recompile Perl
  32. # manually, and then set compile sybperl with the following line
  33. # uncommented:
  34. # UPERL = $(PERLSRC)/uperl.o
  35. #
  36. # The default is to use the third solution:
  37. UPERL = uperl2.o
  38.  
  39.  
  40. HAS_CALLBACK= -DHAS_CALLBACK        # Remove this if you don't
  41.                     # have Perl 4 patchlevel 18
  42.                     # User defined, perl based
  43.                     # error/message handlers are
  44.                     # not possible without this, however.
  45. OLD_SYBPERL= -DOLD_SYBPERL        # some backward compatibility stuff.                    
  46.  
  47. CFLAGS = -O                 # 
  48. CPPFLAGS = -I$(PERLSRC) -I$(LOCINCS) -I$(SYBINCS) $(PERL_VERSION) \
  49.         $(SAVESTR) $(HAS_CALLBACK) $(OLD_SYBPERL)
  50. BINDIR = /usr/local/bin            # where does the executable go
  51. PERLLIB = /usr/local/lib/perl        # where does lib/sybperl.pl
  52.                     # and lib/sybdb.ph go
  53. MANDIR = /usr/local/man            # where do we put the manual page
  54. MANEXT = l
  55.  
  56.  
  57. sybperl: $(UPERL) sybperl.o
  58.     $(CC) $(CFLAGS) -L$(SYBLIBDIR) $(UPERL) sybperl.o $(SYBLIBS) -lm -o sybperl
  59.  
  60. sybperl.o: sybperl.c
  61.     $(CC) -c $(CFLAGS) $(CPPFLAGS) sybperl.c
  62.  
  63. # Create uperl.o IF you wish to use the 3rd way of resolving the
  64. # Perl/Sybase savestr conflict.
  65. $(UPERL): $(PERLSRC)/uperl.o
  66.     cp $(PERLSRC)/uperl.o $(UPERL)
  67.     perl -p -i.bak -e 's/savestr/psvestr/g;' $(UPERL)
  68.  
  69. clean:
  70.     rm -f sybperl *.o *~ core
  71.  
  72. install: sybperl
  73.     install -s -m 775 sybperl $(BINDIR)
  74.     cp lib/syb*.p? $(PERLLIB)/perllib.pl
  75.     cp sybperl.1 $(MANDIR)/man$(MANEXT)/sybperl.$(MANEXT)
  76.  
  77. shar:
  78.     rm -f sybperl.shar
  79.     shar.pl README PACKING.LST BUGS CHANGES Makefile sybperl.c \
  80.     sybperl.1 patchlevel.h lib/sybperl.pl lib/sybdb.ph t/sbex.pl \
  81.     eg/sql.pl eg/space.pl eg/capture.pl eg/report.pl >sybperl.shar
  82.  
  83.  
  84.  
  85.