LIBNAME = share

!include ..\..\..\packages.mif

SRCS = getopt.c getopt1.c &
       alloc.c cuesheet.c file.c picture.c replaygain.c seektable.c snprintf.c &
       replaygain_analysis.c &
       replaygain_synthesis.c &
       charset.c iconvert.c makemap.c utf8.c
# charset_test.c 

OBJS = $(SRCS:.c=.obj)

.c: .\getopt
.c: .\grabbag
.c: .\replaygain_analysis
.c: .\replaygain_synthesis
.c: .\utf8

CFLAGS = $(CFLAGS_LIB) -i=..\..\include
# -zq -mf -3r -fp3 -s -bt=dos -oilrtfm -fr=nul -wx

$(LIBNAME).lib: $(OBJS)
  @echo * Create library: $(LIBFILE)...
  @for %f in ($(OBJS)) do @wlib -b -q $* +%f >nul

.c.obj:
  @wcc386 $(CFLAGS) $<

# iconv() -> const
makemap.obj: makemap.c
  @wcc386 $(CFLAGS) -wcd1179 $<

clean: .SYMBOLIC
  @echo * Clean: $(TITLENAME)
  @if exist *.obj @del *.obj
  @if exist *.err @del *.err
  @if exist $(LIBNAME).lib @del $(LIBNAME).lib
