"Fossies" - the Fresh Open Source Software Archive

Member "units-2.19/Makefile.Win" (20 Oct 2017, 3823 Bytes) of package /linux/misc/units-2.19.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Makefile.Win": 2.14_vs_2.15.

    1 # Makefile for units, a program for units conversion
    2 # created for Microsoft Visual C/C++ under Microsoft Windows(R)
    3 #
    4 # Copyright (C) 1996, 1997, 1999, 2005, 2006, 2012, 2013, 2014, 2017
    5 # Free Software Foundation, Inc
    6 #
    7 # This program is free software; you can redistribute it and/or modify
    8 # it under the terms of the GNU General Public License as published by
    9 # the Free Software Foundation; either version 3 of the License, or
   10 # (at your option) any later version.
   11 #
   12 # This program is distributed in the hope that it will be useful,
   13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15 # GNU General Public License for more details.
   16 #
   17 # You should have received a copy of the GNU General Public License
   18 # along with this program; if not, write to the Free Software
   19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   20 #    
   21 #
   22 # The units program was written by Adrian Mariano (adrianm@gnu.org).
   23 # This makefile was written by Adrian Mariano and Jeff Conrad
   24 # (jeff_conrad@msn.com), and tested with Microsoft Visual Studio 2015
   25 # on Windows 10 Professional.
   26 # It was previously tested with MS Visual C/C++ 6.0, and MS Visual
   27 # Studio 2005, 2008, and 2010 on Windows XP Professional SP3
   28 
   29 # Change these to suit the system configuration
   30 # Normal location on 32-bit system
   31 # ProgFilesDir = %ProgramFiles%
   32 # Normal location for 32-bit executable on 64-bit system
   33 ProgFilesDir = %ProgramFiles(x86)%
   34 
   35 bindir =  "$(ProgFilesDir)\GNU\units"
   36 datadir = "$(ProgFilesDir)\GNU\units"
   37 
   38 srcdir = .
   39 
   40 # These are for Microsoft Visual Studio; edit to suit for other compilers.
   41 # Do NOT give the 'Za' flag with MSVC.
   42 
   43 CC = cl
   44 RC = rc.exe
   45 CFLAGS = /O2 /W3 /nologo
   46 
   47 OBJS = units.obj getopt.obj getopt1.obj parse.obj
   48 
   49 # suppress warnings about "unsafe" functions
   50 CDEFS = /DNO_SETENV /D_CRT_SECURE_NO_WARNINGS
   51 # add this to CDEFS if compiler version doesn't have isfinite()
   52 # /DNO_ISFINITE
   53 UDEFS = /DUNITSFILE=\"definitions.units\" /DLOCALEMAP=\"locale_map.txt\"
   54 RES = units.res
   55 
   56 all: units.exe units_cur.py
   57 
   58 units.exe: $(OBJS) $(RES)
   59 	$(CC) $(CFLAGS) $(CDEFS) $(UDEFS) $(OBJS) $(RES) $(LIBS)
   60 
   61 units.obj: units.c units.h
   62 
   63 getopt.obj: getopt.c
   64 	$(CC) $(CFLAGS) $(CDEFS) /c getopt.c
   65 
   66 getopt1.obj: getopt1.c getopt.h
   67 	$(CC) $(CFLAGS) $(CDEFS) /c getopt1.c
   68 
   69 units.obj: units.c
   70 	$(CC) $(CFLAGS) $(CDEFS) $(UDEFS) /c units.c
   71 
   72 parse.obj: parse.tab.c units.h
   73 	$(CC) $(CFLAGS) $(CDEFS) /c parse.tab.c
   74 	del /f/q parse.obj
   75 	rename parse.tab.obj parse.obj
   76 
   77 units_cur.py: units_cur
   78 	copy units_cur units_cur.py
   79 
   80 showdest:
   81 	@echo datadir=$(datadir) & echo bindir=$(bindir)
   82 	@if not exist "$(ProgFilesDir)" \
   83 	  echo '$(ProgFilesDir)' does not exist and will be created
   84 
   85 install: units.exe
   86 	$(srcdir)\winmkdirs $(bindir) $(datadir)
   87 	copy /y units.exe $(bindir)
   88 	copy /y definitions.units $(datadir)
   89 	copy /y currency.units $(datadir)
   90 	copy /y locale_map.txt $(datadir)
   91 	copy /y unitsfile.ico $(datadir)
   92 	copy /y unitsprog.ico $(datadir)
   93 	cacls $(datadir)\definitions.units /e /g Users:c
   94 	cacls $(datadir)\definitions.units /e /g "Power Users":c
   95 	cacls $(datadir)\currency.units /e /g Users:c
   96 	cacls $(datadir)\currency.units /e /g "Power Users":c
   97 	copy /y units_cur.py $(datadir)
   98 	cacls $(datadir)\units_cur.py /e /g Users:c
   99 	cacls $(datadir)\units_cur.py /e /g "Power Users":c
  100 	assoc .units=Units.DataFile
  101 # change this if you want a different editor for units data files
  102 	for %%i in (notepad.exe) do \
  103 	  if exist %%~$$PATH:i (ftype Units.DataFile="%%~$$PATH:i" "%1") \
  104 	  else (ftype Units.DataFile=notepad.exe "%1")
  105 	reg add "HKCR\Units.DataFile\DefaultIcon" /f /ve /d $(datadir)\unitsfile.ico /t REG_SZ
  106 
  107 clean:
  108 	del /f/q $(OBJS) units_cur.py