Home | History | Annotate | Download | only in uconv
      1 # Copyright (C) 2016 and later: Unicode, Inc. and others.
      2 # License & terms of use: http://www.unicode.org/copyright.html
      3 #**********************************************************************
      4 #* Copyright (C) 1999-2008, International Business Machines Corporation
      5 #* and others.  All Rights Reserved.
      6 #**********************************************************************
      7 # nmake file for creating data files on win32
      8 # invoke with
      9 # nmake /f makedata.mak icup=<path_to_icu_instalation> [Debug|Release]
     10 #
     11 #   12/10/1999  weiv    Created
     12 
     13 #If no config, we default to debug
     14 !IF "$(CFG)" == ""
     15 CFG=Debug
     16 !MESSAGE No configuration specified. Defaulting to common - Win32 Debug.
     17 !ENDIF
     18 
     19 #Here we test if a valid configuration is given
     20 !IF "$(CFG)" != "Release" && "$(CFG)" != "release" && "$(CFG)" != "Debug" && "$(CFG)" != "debug" && "$(CFG)" != "x86\Release" && "$(CFG)" != "x86\Debug" && "$(CFG)" != "x64\Release" && "$(CFG)" != "x64\Debug"
     21 !MESSAGE Invalid configuration "$(CFG)" specified.
     22 !MESSAGE You can specify a configuration when running NMAKE
     23 !MESSAGE by defining the macro CFG on the command line. For example:
     24 !MESSAGE
     25 !MESSAGE NMAKE /f "makedata.mak" CFG="Debug"
     26 !MESSAGE
     27 !MESSAGE Possible choices for configuration are:
     28 !MESSAGE
     29 !MESSAGE "Release"
     30 !MESSAGE "Debug"
     31 !MESSAGE
     32 !ERROR An invalid configuration is specified.
     33 !ENDIF
     34 
     35 #Let's see if user has given us a path to ICU
     36 #This could be found according to the path to makefile, but for now it is this way
     37 !IF "$(ICUP)"==""
     38 !ERROR Can't find path!
     39 !ENDIF
     40 !MESSAGE ICU path is $(ICUP)
     41 
     42 RESNAME=uconvmsg
     43 RESDIR=resources
     44 RESFILES=resfiles.mk
     45 ICUDATA=$(ICUP)\data
     46 
     47 DLL_OUTPUT=.\$(CFG)
     48 # set the following to 'static' or 'dll' depending
     49 PKGMODE=static
     50 
     51 ICD=$(ICUDATA)^\
     52 DATA_PATH=$(ICUP)\data^\
     53 
     54 !IF "$(CFG)" == "x64\Release" || "$(CFG)" == "x64\Debug"
     55 ICUTOOLS=$(ICUP)\bin64
     56 PATH = $(ICUP)\bin64;$(PATH)
     57 !ELSE
     58 ICUTOOLS=$(ICUP)\bin
     59 PATH = $(ICUP)\bin;$(PATH)
     60 !ENDIF
     61 
     62 # Make sure the necessary tools exist before continuing. (This is to prevent cryptic errors from NMAKE).
     63 !IF !EXISTS($(ICUTOOLS)\pkgdata.exe)
     64 !MESSAGE Unable to find "$(ICUTOOLS)\pkgdata.exe"
     65 !ERROR The tool 'pkgdata.exe' does not exist! (Have you built all of ICU yet?).
     66 !ENDIF
     67 !IF !EXISTS($(ICUTOOLS)\genrb.exe)
     68 !MESSAGE Unable to find "$(ICUTOOLS)\genrb.exe"
     69 !ERROR The tool 'genrb.exe' does not exist! (Have you built all of ICU yet?).
     70 !ENDIF
     71 
     72 # Suffixes for data files
     73 .SUFFIXES : .ucm .cnv .dll .dat .res .txt .c
     74 
     75 # We're including a list of resource files.
     76 FILESEPCHAR=
     77 
     78 !IF EXISTS("$(RESFILES)")
     79 !INCLUDE "$(RESFILES)"
     80 !ELSE
     81 !ERROR ERROR: cannot find "$(RESFILES)"
     82 !ENDIF
     83 RES_FILES = $(RESSRC:.txt=.res)
     84 RB_FILES = resources\$(RES_FILES:.res =.res resources\)
     85 RESOURCESDIR=
     86 
     87 # This target should build all the data files
     88 !IF "$(PKGMODE)" == "dll"
     89 OUTPUT = "$(DLL_OUTPUT)\$(RESNAME).dll"
     90 !ELSE
     91 OUTPUT = "$(DLL_OUTPUT)\$(RESNAME).lib"
     92 !ENDIF
     93 
     94 ALL : $(OUTPUT)
     95     @echo All targets are up to date (mode $(PKGMODE))
     96 
     97 
     98 # invoke pkgdata - static
     99 "$(DLL_OUTPUT)\$(RESNAME).lib" : $(RB_FILES) $(RESFILES)
    100     @echo Building $(RESNAME).lib
    101     @"$(ICUTOOLS)\pkgdata" -f -v -m static -c -p $(RESNAME) -d "$(DLL_OUTPUT)" -s "$(RESDIR)" <<pkgdatain.txt
    102 $(RES_FILES:.res =.res
    103 )
    104 <<KEEP
    105 
    106 # This is to remove all the data files
    107 CLEAN :
    108     -@erase "$(RB_FILES)"
    109     -@erase "$(CFG)\*uconvmsg*.*"
    110     -@"$(ICUTOOLS)\pkgdata" -f --clean -v -m static -c -p $(RESNAME) -d "$(DLL_OUTPUT)" -s "$(RESDIR)" pkgdatain.txt
    111 
    112 # Inference rule for creating resource bundles
    113 {$(RESDIR)}.txt{$(RESDIR)}.res:
    114     @echo Making Resource Bundle files
    115     "$(ICUTOOLS)\genrb" -s $(@D) -d $(@D) $(?F)
    116 
    117 $(RESSRC) : {"$(ICUTOOLS)"}genrb.exe
    118