home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / pascal2c / makefile < prev    next >
Makefile  |  1992-08-04  |  3KB  |  106 lines

  1. # Makefile for "p2c", the Pascal to C translator.
  2. #  Copyright (C) 1989, 1990, 1991 Free Software Foundation.
  3. #  Author: Dave Gillespie.
  4. #  Author's address: daveg@csvax.caltech.edu; 256-80 Caltech/Pasadena CA 91125.
  5.  
  6.    #######################################################################
  7.    #                                                                     #
  8.    #  08-04-1992                                                         #
  9.    #                                                                     #
  10.    #  Modified by Bernt Karasch for OS/2 v 2.0 (gcc/emx and nmake)       #
  11.    #  (Internet : hermann.gies@ruba.rz.ruhr-uni-bochum.dbp.de            #
  12.    #   Snailmail: Ruhr-Universitaet Bochum, Institut fuer Mineralogie,   #
  13.    #              Herrn Bernt Karasch, Universitaetsstrasse 150,         #
  14.    #              W-4630 Bochum 1, Federal Republic of Germany)          #
  15.    #                                                                     #
  16.    #######################################################################
  17.  
  18. # This program is free software; you can redistribute it and/or modify
  19. # it under the terms of the GNU General Public License as published by
  20. # the Free Software Foundation (any version).
  21.  
  22. # This program is distributed in the hope that it will be useful,
  23. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  25. # GNU General Public License for more details.
  26.  
  27. # You should have received a copy of the GNU General Public License
  28. # along with this program; see the file COPYING.  If not, write to
  29. # the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  30.  
  31.  
  32. # Compiler options
  33. CC = gcc                  
  34. OPT = -O2           # for optimization
  35. DEB = # -g           # uncomment this for debugging
  36. DEFS =               # place other -D types of things here
  37. CFLAGS = $(OPT) $(DEB) $(DEFS)
  38. LFLAGS =
  39.  
  40.  
  41. # Custom translator modules
  42. CUSTSRCS = hpmods.c citmods.c
  43. CUSTOBJS = hpmods.o citmods.o
  44. CUSTDEFS = -DCUST1=hpmods -DCUST2=citmods
  45.  
  46.  
  47. # File names
  48. P2CSRCS = trans.c stuff.c out.c comment.c lex.c parse.c decl.c \
  49.           expr.c pexpr.c funcs.c dir.c
  50. P2COBJS = stuff.o out.o comment.o lex.o parse.o decl.o \
  51.           expr.o pexpr.o funcs.o 
  52. SPECIAL = trans.o dir.o
  53.  
  54. SRCS = $(P2CSRCS) $(CUSTSRCS)
  55. OBJS = $(P2COBJS) $(SPECIAL) $(CUSTOBJS) 
  56. XOBJ = $(P2COBJS) $(CUSTOBJS)
  57.  
  58. LIBSRCS = p2clib.c locp2clb.c
  59. LIBOBJS = p2clib.o locp2clb.o
  60. OTHERLIBOBJS =
  61.  
  62. MISCSRCS = makeprot.c
  63. PROTOS = p2c.pro p2c.hdr
  64.  
  65.  
  66. # Top-level targets
  67. all: proto p2c libp2c.a 
  68. proto: $(PROTOS)
  69.  
  70.  
  71. # Making p2c
  72. p2c: $(OBJS)
  73.     $(CC) $(LFLAGS) $(OBJS) -o p2c.exe
  74.  
  75. dir.o: dir.c trans.h
  76.     $(CC) -c $(CFLAGS) $(CUSTDEFS) dir.c
  77.  
  78. trans.o: trans.c trans.h
  79.     $(CC) -c $(CFLAGS) -DHASDUMPS trans.c
  80.  
  81. $(XOBJ):
  82.         $(CC) -c $(CFLAGS) $*.c
  83.  
  84.  
  85. # Making and using makeproto
  86. p2c.hdr: $(SRCS) makeprot
  87.     makeprot -n -m -h -t16 -a35 -s0 -x $(SRCS) -o p2c.hdr
  88.  
  89. p2c.pro: $(SRCS) makeprot
  90.     makeprot -n -m -h -t16 -a35 -s1 -i $(SRCS) -o p2c.pro
  91.  
  92. makeprot: makeprot.c
  93.     $(CC) $(CFLAGS) $(LFLAGS) makeprot.c -o makeprot.exe
  94.  
  95.  
  96. # Making the p2c runtime library
  97. libp2c.a: $(LIBOBJS)
  98.     ar r libp2c.a $(LIBOBJS) $(OTHERLIBOBJS)
  99.  
  100. p2clib.o: p2clib.c
  101.     $(CC) -c $(CFLAGS) p2clib.c
  102.  
  103. locp2clb.o: locp2clb.c
  104.     $(CC) -c $(CFLAGS) locp2clb.c
  105.  
  106.