Home | History | Annotate | Download | only in scripts
      1 # Makefile for libpng
      2 # 32-bit Borland C++ (Note: All modules are compiled in C mode)
      3 # To build the library, do:
      4 #       "make -fmakefile.bc32"
      5 #
      6 # -------------------- 32-bit Borland C++ --------------------
      7 
      8 ### Absolutely necessary for this makefile to work
      9 .AUTODEPEND
     10 
     11 ## Where zlib.h, zconf.h and zlib.lib are
     12 ZLIB_DIR=..\zlib
     13 
     14 ## Compiler, linker, librarian and other tools
     15 CC=bcc32
     16 LD=bcc32
     17 LIB=tlib
     18 CP=copy
     19 
     20 # -3 = 386, -4 = 486, -5 = Pentium etc.
     21 !ifndef TARGET_CPU
     22 #TARGET_CPU=-6
     23 !endif
     24 
     25 # Use this if you don't want Borland's fancy exception handling
     26 # (Caution: doesn't work with CBuilderX)
     27 #NOEHLIB=noeh32.lib
     28 
     29 !ifdef DEBUG
     30 CDEBUG=-v
     31 LDEBUG=-v
     32 !else
     33 CDEBUG=
     34 LDEBUG=
     35 !endif
     36 
     37 # STACKOFLOW=1
     38 !ifdef STACKOFLOW
     39 CDEBUG=$(CDEBUG) -N
     40 LDEBUG=$(LDEBUG) -N
     41 !endif
     42 
     43 # -O2 optimize for speed
     44 # -d  merge duplicate strings
     45 # -k- turn off standard stack frame
     46 # -w  display all warnings
     47 CPPFLAGS=-I$(ZLIB_DIR)
     48 CFLAGS=-O2 -d -k- -w $(TARGET_CPU) $(CDEBUG)
     49 
     50 # -M  generate map file
     51 LDFLAGS=-L$(ZLIB_DIR) -M $(LDEBUG)
     52 
     53 # Pre-built configuration
     54 # See scripts\pnglibconf.mak for more options
     55 !ifndef PNGLIBCONF_H_PREBUILT
     56 PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
     57 !endif
     58 
     59 ## Variables
     60 OBJS = \
     61 	png.obj \
     62 	pngerror.obj \
     63 	pngget.obj \
     64 	pngmem.obj \
     65 	pngpread.obj \
     66 	pngread.obj \
     67 	pngrio.obj \
     68 	pngrtran.obj \
     69 	pngrutil.obj \
     70 	pngset.obj \
     71 	pngtrans.obj \
     72 	pngwio.obj \
     73 	pngwrite.obj \
     74 	pngwtran.obj \
     75 	pngwutil.obj
     76 
     77 LIBOBJS = \
     78 	+png.obj \
     79 	+pngerror.obj \
     80 	+pngget.obj \
     81 	+pngmem.obj \
     82 	+pngpread.obj \
     83 	+pngread.obj \
     84 	+pngrio.obj \
     85 	+pngrtran.obj \
     86 	+pngrutil.obj \
     87 	+pngset.obj \
     88 	+pngtrans.obj \
     89 	+pngwio.obj \
     90 	+pngwrite.obj \
     91 	+pngwtran.obj \
     92 	+pngwutil.obj
     93 
     94 LIBNAME=libpng.lib
     95 
     96 ## Implicit rules
     97 # Braces let make "batch" calls to the compiler,
     98 # 2 calls instead of 12; space is important.
     99 .c.obj:
    100 	$(CC) $(CPPFLAGS) $(CFLAGS) -c {$*.c }
    101 
    102 .c.exe:
    103 	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $*.c \
    104 	  $(LIBNAME) zlib.lib $(NOEHLIB)
    105 
    106 .obj.exe:
    107 	$(LD) $(LDFLAGS) $*.obj $(LIBNAME) zlib.lib $(NOEHLIB)
    108 
    109 ## Major targets
    110 all: libpng pngtest
    111 
    112 libpng: $(LIBNAME)
    113 
    114 pngtest: pngtest.exe
    115 
    116 test: pngtest.exe
    117 	pngtest
    118 
    119 ## Minor Targets
    120 
    121 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
    122 	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
    123 
    124 png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    125 pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    126 pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    127 pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    128 pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    129 pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    130 pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    131 pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    132 pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    133 pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    134 pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    135 pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    136 pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    137 pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    138 pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
    139 pngtest.obj: pngtest.c png.h pngconf.h pnglibconf.h
    140 
    141 $(LIBNAME): $(OBJS)
    142 	-del $(LIBNAME)
    143 	$(LIB) $(LIBNAME) @&&|
    144 $(LIBOBJS), libpng
    145 |
    146 
    147 # Cleanup
    148 clean:
    149 	-del pnglibconf.h
    150 	-del *.obj
    151 	-del $(LIBNAME)
    152 	-del pngtest.exe
    153 	-del *.lst
    154 	-del *.map
    155 	-del *.tds
    156 	-del pngout.png
    157 
    158 # End of makefile for libpng
    159