129 lines
2.2 KiB
Makefile
129 lines
2.2 KiB
Makefile
# Pull in the .o vars if they haven't been read already
|
|
ifeq (,$(MAKEFILE_O_VARS))
|
|
include $(DTOOL)/inc/Makefile.o.vars
|
|
endif
|
|
|
|
# Get the project root
|
|
ifeq (,$(CTPROJROOT))
|
|
CTPROJROOT := $(shell $(DTOOL)/bin/ctproj -root)
|
|
export CTPROJROOT
|
|
endif
|
|
|
|
# Set the SOLOCATIONS file
|
|
SOLOCATIONS := ../../etc/so_locations
|
|
|
|
# Make sure CT_LIBRARY_PATH is set.
|
|
ifeq (,$(CT_LIBRARY_PATH))
|
|
ifneq (,$(LD_LIBRARY_PATH))
|
|
export CT_LIBRARY_PATH := $(LD_LIBRARY_PATH)
|
|
else
|
|
export CT_LIBRARY_PATH = .
|
|
endif
|
|
endif
|
|
|
|
LPATH_DIRS := $(strip $(shell ctpathadjust $(subst :, ,$(CT_LIBRARY_PATH)))) $(patsubst -L%,%,$(LPATH))
|
|
|
|
# Legacy.
|
|
ifneq (,$(PYTHON_LIB))
|
|
LPATH_DIRS += $(PYTHON_LIB)
|
|
endif
|
|
ifneq (,$(NSPR_LIB))
|
|
LPATH_DIRS += $(NSPR_LIB)
|
|
endif
|
|
|
|
ifeq (WIN32_VC,$(PENV_COMPILER))
|
|
LPATH := $(foreach path,$(LPATH_DIRS),-LIBPATH:"$(shell cygpath -w $(path))")
|
|
else # NON-WIN32_VC
|
|
LPATH := $(patsubst %,-L%,$(LPATH_DIRS))
|
|
endif # WIN32_VC
|
|
|
|
ifeq (SGI,$(PENV))
|
|
CLDFLAGS = -Wl,-force_load -Wl,-transitive_link
|
|
C++LDFLAGS = -Wl,-demangle -Wl,-force_load -Wl,-transitive_link
|
|
endif
|
|
|
|
# Figure out what the linker is. Start with simple defaults.
|
|
|
|
ifeq (PS2, $(PENV))
|
|
AR = ee-ar
|
|
LD = ee-ld
|
|
else
|
|
AR = ar
|
|
LD = ld
|
|
endif
|
|
|
|
LDFLAGS =
|
|
LINKFLAGS =
|
|
|
|
# C files
|
|
ifneq (,$(CFILES))
|
|
LD := $(CC)
|
|
LDFLAGS := $(CLDFLAGS) $(CFLAGS)
|
|
endif
|
|
|
|
# C++ files
|
|
ifneq (,$(C++FILES)) # If there are C++ files, make it CC
|
|
LD := $(C++)
|
|
LDFLAGS := $(C++LDFLAGS) $(C++FLAGS)
|
|
endif
|
|
|
|
# C files in the OFILES list
|
|
ifneq (,$(findstring .c,$(suffix $(OFILES))))
|
|
LD := $(CC)
|
|
LDFLAGS := $(IPATH) $(CLDFLAGS) $(CFLAGS)
|
|
endif
|
|
|
|
# C++ files in the OFILES list
|
|
ifneq (,$(findstring .cxx,$(suffix $(OFILES))))
|
|
LD := $(C++)
|
|
LDFLAGS := $(IPATH) $(C++LDFLAGS) $(C++FLAGS)
|
|
endif
|
|
|
|
# Making a DSO - use C++ for now
|
|
ifeq (.so,$(suffix $(TARGET)))
|
|
LD := $(C++)
|
|
LDFLAGS := $(IPATH) $(C++LDFLAGS) $(C++FLAGS)
|
|
endif
|
|
|
|
# Making a DLL - use C++ for now
|
|
ifeq (.dll,$(suffix $(TARGET)))
|
|
LD := $(C++)
|
|
LDFLAGS := $(C++LDFLAGS) $(C++FLAGS)
|
|
endif
|
|
|
|
# Making a WIN binary file
|
|
ifeq (WIN32,$(PENV))
|
|
LD = link
|
|
LDFLAGS = -NOLOGO
|
|
|
|
ifeq (4,$(OPTIMIZE))
|
|
LINKFLAGS += -fixed:no
|
|
else
|
|
ifeq (3,$(OPTIMIZE))
|
|
LINKFLAGS += -fixed:no
|
|
else
|
|
LINKFLAGS += -debug -incremental:no
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
ARFLAGS = ruv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|