Change structure of platform detection. Now may specify a platform to call 'make PLATFORM=plf'

This commit is contained in:
Stas Degteff 2005-10-27 18:41:49 +00:00
parent 70f54bd223
commit 569fa90b09

View File

@ -1,31 +1,47 @@
# -*- makefile -*- # -*- makefile -*-
ifndef PLATFORM
ifeq ($(TERM),cygwin) ifeq ($(TERM),cygwin)
MINGW=true MINGW=true
PLATFORM=cyg
else else
ifeq ($(OSTYPE),msys) ifeq ($(OSTYPE),msys)
MINGW=true MINGW=true
PLATFORM=cyg
endif endif
endif endif
ifdef MINGW ifeq ($(findstring EMX, $(PATH)), EMX)
PLATFORM=emx
endif
ifneq ($(DJGPP),) # DJGPP build (enviroment variable 'DJGPP' is defined)
PLATFORM=djg
endif
ifeq ($(OSTYPE),beos) # BeOS build
PLATFORM=be
endif
endif # ifndef PLATFORM
ifeq ($(PLATFORM),cyg)
CAT=cat CAT=cat
CC=gcc -mno-cygwin CC=gcc -mno-cygwin
CXX=g++ -mno-cygwin CXX=g++ -mno-cygwin
AR=ar AR=ar
RANLIB=ranlib RANLIB=ranlib
WINDRES=windres WINDRES=windres
PLATFORM=cyg
EXEEXT=.exe EXEEXT=.exe
OBJEXT=.o OBJEXT=.o
LIBEXT=.a LIBEXT=.a
else else
ifeq ($(findstring EMX, $(PATH)), EMX) ifeq ($(PLATFORM),emx)
CAT=cat CAT=cat
CC=gcc CC=gcc
AR=ar AR=ar
RANLIB=ar s RANLIB=ar s
PLATFORM=emx
SHELL=bash SHELL=bash
EXEEXT=.exe EXEEXT=.exe
OBJEXT=.o OBJEXT=.o
@ -40,30 +56,28 @@ LIBEXT=.a
#LIBEXT=.lib #LIBEXT=.lib
CXX=$(CC) CXX=$(CC)
else else
ifneq ($(DJGPP),) ifeq ($(PLATFORM),djg)
CAT=command.com /c type CAT=command.com /c type
CC=gcc CC=gcc
CXX=gxx CXX=gxx
AR=ar AR=ar
RANLIB=ranlib RANLIB=ranlib
PLATFORM=djg SHELL=sh
SHELL=shdos16.exe
EXEEXT=.exe EXEEXT=.exe
OBJEXT=.o OBJEXT=.o
LIBEXT=.a LIBEXT=.a
else else
ifeq ($(OSTYPE),beos) # BeOS build ifeq ($(PLATFORM),be)
CAT=cat CAT=cat
CC=gcc CC=gcc
CXX=g++ CXX=g++
AR=ar AR=ar
RANLIB=ranlib RANLIB=ranlib
PLATFORM=be
EXEEXT= EXEEXT=
OBJEXT=.o OBJEXT=.o
LIBEXT=.a LIBEXT=.a
LNKFLAGS+=-lbe -ltextencoding LNKFLAGS+=-lbe -ltextencoding
else else # Linux, *BSD or another unix-like OS
CAT=cat CAT=cat
CC=gcc CC=gcc
CXX=g++ CXX=g++