# Makefile for locale.lib
# Copyright (c) 1997 by Timofei Bondarenko
#--------------------------------------------------------------#
# NOTE: No dependents from the Makefile are declared. Thus,
#	You should explictly tell make to rebuild all targets
#	when you change a command-line option.
#
# For Watcom WMAKE -u should be used
#--------------------------------------------------------------#
# See at config.h for compile-time options
#--------------------------------------------------------------#
# Select Your "C_Compilation_System" here
#CCS_WATCOM=
CCS_BORLAND=
#CCS_MICROSOFT=

#--------------------------------------------------------------#
# Common Definitions

INSTALLDIR =..\..\OBJ

# Destinations

all: locale.lib

test.exe: test.c locale.lib
!ifdef CCS_BORLAND
#	bcc32 -ml -WSE test.c locale.lib
	bcc -ml test.c locale.lib
!endif
!ifdef CCS_MICROSOFT
	set LIB=d:\msvc15\lib
	cl /AL -Id:\msvc15\include test.c locale.lib
!endif
!ifdef CCS_WATCOM
#	wcl /fm/ml/l=dos $(INCLUDEDIR) $<
#	wcl /fm/bw/ml/l=windows/bt=windows $(INCLUDEDIR) $< ole2nls.lib
	wcl386 /fm/bw/l=win386/bt=windows $(INCLUDEDIR) $<
	wbind test -n
#	wcl386 /fm/bw/l=nt_win/bt=nt $< 
#	wcl386 /fm/l=dos4g /bt=dos $<
!endif

O=.obj
!include depends.

install: $(INSTALLDIR)/locale.lib

clean:
	del *.obj
	del *.lib
	del *.bak
	del *.err

#==============================================================#
# Compiler-dependent definitions

!ifdef CCS_WATCOM
# Definitions for Watcom C/C++ 11.0
# "wcc" valid flags are:
# -zq = be quiet; -wx = all warnings; -s = don't check stack;
# -os = optimize for size; -j = signed char; -zc = string in CONSTseg;
# -ml = Large Model; -2 = 286 Code Set; -3 = 386 Code Set;
# -nt = seg name; -zW = Windows 16; -zdp = ds=DGROUP
#***
AR =wlib -c -b
CFLAGS =-zq-wx-wcd=300-s-os-zc -DUSE_NATIVE_INTERFACE -DSTRFTIME_EXT=1
INCLUDEDIR =-ID:\WATCOM\h
#*** Definitions for Watcom C, 16-bit
#CC =wcc
#*** MS-DOS 16-bit
#CFLAGS += -ml-2 -bt=dos -nt=LOCALE_TEXT
#*** Windows 3x, Windows 386
CFLAGS += -DSTRFTIME_WIN=1
CFLAGS += -bt=windows
INCLUDEDIR +=;D:\WATCOM\h\win
#*** Windows 16-bit
#CFLAGS += -ml-3-zW -nt=LOCALE_TEXT
#CFLAGS += -DUSE_OLENLS
#*** Definitions for Watcom C, 32-bit
CC =wcc386
#*** MS-DOS 32-bit
# -DDOS_FAR_MODE=4 for DOS/4GW
# -DDOS_FAR_MODE=5 or 6 for PharLap
#CFLAGS += -bt=dos -DDOS_FAR_MODE=4
#*** Win32
#INCLUDEDIR +=;D:\WATCOM\h\nt
#CFLAGS += -bt=nt
#***

locale.lib: $(OBJS)
	-@del $@
	*$(AR) $@ $<
!endif

!ifdef CCS_BORLAND
# Definitions for Borland C++
#*** "bcc" flags are:
# -w-pia = Disable "Possibly Incorrect Assignement" Warning
# -RT- = Disable RTTI; -x- = Disable Exceptions
# -ml = Large Model; -2 = 286 Code Set; -3 = 386 Code Set
# -d = merge dup.string; -dc = const in CODEseg
# -Y = Overlay Support; -k- = short stack frame
# -WSE = Windows,Smart-Callback,Explict-Exportable
#***
.AUTODEPEND
AR =tlib /C
INCLUDEDIR =-ID:\BC\INCLUDE
#*** Definitions for Borland C, 16-bit
CC =bcc -w-pia
#*** MS-DOS 16-bit
CFLAGS =-O1 -ml -2 -Y -d -zCLOCALE_TEXT
#*** Windows 16-bit
#CFLAGS =-O1 -ml -3 -d -WSE -zCLOCALE_TEXT -DSTRFTIME_WIN=1
# -dc -D_RTLDLL
#*** Definitions for Borland C, Win32
#CC =bcc32 -w-pia
#CFLAGS =-O1 -d -RT- -x- -DSTRFTIME_WIN=1 -D_RTLDLL
#***

locale.lib: $(OBJS)
	&$(AR) $@ -+$?
	-del $*.bak
!endif

!ifdef CCS_MICROSOFT
# Definitions for Microsoft C
#*** "cl" flags are:
# /AL = Large Model; /G2 = 286 Code Set; /W3 = warnings
# /Gs = No ChkStack; /Gf = merge dup.string
#***
CC =cl /nologo
AR =lib /NOIGNORECASE
INCLUDEDIR =-ID:\MSVC15\INCLUDE
#*** MS-DOS 16-bit
CFLAGS =/O1 /AL /G2 /Gs /Gf /NT_TEXT /ND_DATA /W3
#***

locale.lib: $(OBJS)
	$(AR) $@ -+$(?:.obj = -+),,
	-del $*.bak
!endif

#==============================================================#
# Rules
#--------------------------------------------------------------#

# Implicit Rules
!ifdef CCS_WATCOM
.c.obj : .AUTODEPEND
	*$(CC) $(CFLAGS) $(INCLUDEDIR) $[*
!else
.c.obj :
	$(CC) -c $(CFLAGS) $(INCLUDEDIR) { $< }
!endif

$(INSTALLDIR)/locale.lib: locale.lib
	copy $? $(INSTALLDIR)

# The end