OPT=-O2 

CC=gcc
CPP=gcc -E
PRECOMPILE=${CPP} -dD
YACC=yacc
LEX=lex
INSTALL=install
AR=ar
RANLIB=ranlib
INDENT=indent -i2 -ts0
MAKEDEPEND=makedepend
CPROTO=cproto
RCSCI=ci

PALMCC = m68k-palmos-gcc
PALMGDB = m68k-palmos-gdb
PILRC = pilrc
PALMOBJRES = m68k-palmos-obj-res
BUILDPRC = build-prc
PILOTXFER = pilot-xfer
PILOTMATHLIB=-lmf
PALMOPT=-O2 -fno-builtin
PILOTPORT=/dev/ttyS0

WARN=-Wall -Wstrict-prototypes -Wno-unused
PALMWARN=-Wstrict-prototypes -Wno-unused

XINC=
XLIB=-L/usr/X11R6/lib -lX11
OPENWINHOME=/usr/openwin

DBINC=-I/software/include
DBLIB=-L/software/lib -ldb
ESDINC=
ESDLIB=-lesd

ARCH=$(shell arch)

ifeq (alpha,${ARCH}) 
  MPGDMOD=decode.o dct64.o
  MPGDEFINES=-DLINUX 
  MPGOPT=-fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math -Wall -O6 
  MATHLIB=-lcpml
  MIXERSRC=linux.c
else
  ifeq (i386,${ARCH})
    MPGDMOD=decode_i386.o dct64_i386.o decode_i586.o
    MPGDEFINES=-DI386_ASSEM -DREAL_IS_FLOAT -DPENTIUM_OPT -DLINUX
    MPGOPT=-Wall  -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math
    MATHLIB=-lm
    MIXERSRC=linux.c
  else
    ifeq (i486,${ARCH})
      MPGDMOD=decode_i386.o dct64_i386.o decode_i586.o
      MPGDEFINES=-DI386_ASSEM -DREAL_IS_FLOAT -DPENTIUM_OPT -DLINUX
      MPGOPT=-Wall  -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math
      MATHLIB=-lm
      MIXERSRC=linux.c
    else
      ifeq (i586,${ARCH})
        MPGDMOD=decode_i386.o dct64_i386.o decode_i586.o
        MPGDEFINES=-DI386_ASSEM -DREAL_IS_FLOAT -DPENTIUM_OPT -DLINUX
        MPGOPT=-Wall  -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math
        MATHLIB=-lm
        MIXERSRC=linux.c
      else
        ifeq (i686,${ARCH})
          MPGDMOD=decode_i386.o dct64_i386.o decode_i586.o
          MPGDEFINES=-DI386_ASSEM -DREAL_IS_FLOAT -DPENTIUM_OPT -DLINUX
          MPGOPT=-Wall  -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math
          MATHLIB=-lm
          MIXERSRC=linux.c
        else
          ifeq (amd,${ARCH})
            MPGDMOD=decode_i386.o dct64_3dnow.o decode_3dnow.o
            MPGDEFINES=-DI386_ASSEM -DREAL_IS_FLOAT -DPENTIUM_OPT -DLINUX -DUSE_3DNOW
            MPGOPT=-Wall -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math
            MATHLIB=-lm
            MIXERSRC=linux.c
          else
            ifeq (sun4,${ARCH})
              MPGDMOD=decode.o dct64.o
              MPGOPT=-O2 -funroll-loops
              MPGDEFINES=-DREAL_IS_FLOAT -DSOLARIS
              MATHLIB=-lm
              MIXERSRC=sunos.c
            else
              MPGDMOD=decode.o dct64.o
              MPGOPT=-O 
              MPGDEFINES=-DGENERIC
              MATHLIB=-lm
              MIXERSRC=generic.c
            endif
          endif
        endif
      endif
    endif
  endif
endif


