github.com/cellofellow/gopkg@v0.0.0-20140722061823-eec0544a62ad/image/jxr/jxrlib/Makefile (about)

     1  ##//*@@@+++@@@@******************************************************************
     2  ##//
     3  ##// Copyright Microsoft Corp.
     4  ##// All rights reserved.
     5  ##// 
     6  ##// Redistribution and use in source and binary forms, with or without
     7  ##// modification, are permitted provided that the following conditions are met:
     8  ##// 
     9  ##// Redistributions of source code must retain the above copyright notice,
    10  ##//   this list of conditions and the following disclaimer.
    11  ##// Redistributions in binary form must reproduce the above copyright notice,
    12  ##//   this list of conditions and the following disclaimer in the documentation
    13  ##//   and/or other materials provided with the distribution.
    14  ##// 
    15  ##// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    16  ##// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    17  ##// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    18  ##// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    19  ##// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    20  ##// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    21  ##// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    22  ##// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    23  ##// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    24  ##// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    25  ##// POSSIBILITY OF SUCH DAMAGE.
    26  ##//
    27  ##//*@@@---@@@@******************************************************************
    28  ## Makefile for building JPEG XR Porting Kit
    29  ##
    30  build: all
    31  
    32  CC=cc
    33  
    34  DIR_SYS=image/sys
    35  DIR_DEC=image/decode
    36  DIR_ENC=image/encode
    37  
    38  DIR_GLUE=jxrgluelib
    39  DIR_TEST=jxrtestlib
    40  DIR_EXEC=jxrencoderdecoder
    41  
    42  CFLAGS=-I. -Icommon/include -I$(DIR_SYS) -D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O
    43  ##
    44  ## Add following flag to CFLAGS above if target is a big endian machine
    45  ## -D_BIG__ENDIAN_
    46  ##
    47  ##--------------------------------
    48  ##
    49  ## Common files
    50  ##
    51  
    52  OBJ_SYS=adapthuff.o image.o strcodec.o strPredQuant.o strTransform.o perfTimerANSI.o
    53  
    54  $(OBJ_SYS):
    55  	$(CC) $(CFLAGS) -c $(DIR_SYS)/$*.c
    56  
    57  
    58  ##--------------------------------
    59  ##
    60  ## Decode files
    61  ##
    62  
    63  OBJ_DEC=decode.o postprocess.o segdec.o strdec.o strInvTransform.o strPredQuantDec.o JXRTranscode.o
    64  
    65  $(OBJ_DEC):
    66  	$(CC) $(CFLAGS) -c $(DIR_DEC)/$*.c
    67  
    68  
    69  ##--------------------------------
    70  ##
    71  ## Encode files
    72  ##
    73  
    74  OBJ_ENC=encode.o segenc.o strenc.o strFwdTransform.o strPredQuantEnc.o
    75  
    76  $(OBJ_ENC):
    77  	$(CC) $(CFLAGS) -c $(DIR_ENC)/$*.c
    78  
    79  ##--------------------------------
    80  ##
    81  ## JPEG XR library
    82  ##
    83  
    84  libjpegxr.a: $(OBJ_ENC) $(OBJ_DEC) $(OBJ_SYS)
    85  	ar rvu $@ $(OBJ_ENC) $(OBJ_DEC) $(OBJ_SYS)
    86  	ranlib $@
    87  
    88  ##--------------------------------
    89  ##
    90  ## Glue files
    91  ##
    92  
    93  OBJ_GLUE=JXRGlue.o JXRMeta.o JXRGluePFC.o JXRGlueJxr.o
    94  
    95  $(OBJ_GLUE):
    96  	$(CC) $(CFLAGS) -I$(DIR_GLUE) -c $(DIR_GLUE)/$*.c
    97  
    98  ##--------------------------------
    99  ##
   100  ## Test files
   101  ##
   102  
   103  OBJ_TEST=JXRTest.o JXRTestBmp.o JXRTestHdr.o JXRTestPnm.o JXRTestTif.o JXRTestYUV.o
   104  
   105  $(OBJ_TEST):
   106  	$(CC) $(CFLAGS) -I$(DIR_GLUE) -I$(DIR_TEST) -c $(DIR_TEST)/$*.c
   107  
   108  ##--------------------------------
   109  ##
   110  ## JPEG XR Glue library
   111  ##
   112  libjxrglue.a: $(OBJ_GLUE) $(OBJ_TEST)
   113  	ar rvu $@ $(OBJ_GLUE) $(OBJ_TEST)
   114  	ranlib $@
   115  
   116  ##--------------------------------
   117  ##
   118  ## Enc app files
   119  ##
   120  
   121  LIBRARIES=libjxrglue.a libjpegxr.a
   122  LIBS=-L. $(LIBRARIES) -lm
   123  ENCAPP=JxrEncApp
   124  
   125  $(ENCAPP): $(LIBRARIES) 
   126  	$(CC) $(DIR_EXEC)/$(ENCAPP).c -o $(ENCAPP) $(CFLAGS) -I$(DIR_GLUE) -I$(DIR_TEST) $(LIBS)
   127  
   128  ##--------------------------------
   129  ##
   130  ## Dec app files
   131  ##
   132  
   133  DECAPP=JxrDecApp
   134  
   135  $(DECAPP): $(LIBRARIES) 
   136  	$(CC) $(DIR_EXEC)/$(DECAPP).c -o $(DECAPP) $(CFLAGS) -I$(DIR_GLUE) -I$(DIR_TEST) $(LIBS)
   137  
   138  ##--------------------------------
   139  ##
   140  ## JPEG XR library
   141  ##
   142  all: $(ENCAPP) $(DECAPP)
   143  
   144  clean:
   145  	rm -rf *App *.o libj*.a 
   146  
   147  ##