michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: MOZ_WIDGET_TOOLKIT = os2 michael@0: michael@0: # XP_PC is for Window and OS2 on Intel X86 michael@0: # XP_OS2 is strictly for OS2 only michael@0: XP_DEFINE += -DXP_PC=1 -DXP_OS2=1 michael@0: michael@0: # Override prefix michael@0: LIB_PREFIX = $(NULL) michael@0: michael@0: # Override suffix in suffix.mk michael@0: LIB_SUFFIX = lib michael@0: # the DLL_SUFFIX must be uppercase for FIPS mode to work. bugzilla 240784 michael@0: DLL_SUFFIX = DLL michael@0: PROG_SUFFIX = .exe michael@0: michael@0: michael@0: CCC = gcc michael@0: LINK = gcc michael@0: AR = emxomfar r $@ michael@0: # Keep AR_FLAGS blank so that we do not have to change rules.mk michael@0: AR_FLAGS = michael@0: RANLIB = @echo OS2 RANLIB michael@0: BSDECHO = @echo OS2 BSDECHO michael@0: IMPLIB = emximp -o michael@0: FILTER = emxexp -o michael@0: michael@0: # GCC for OS/2 currently predefines these, but we don't want them michael@0: DEFINES += -Uunix -U__unix -U__unix__ michael@0: michael@0: DEFINES += -DTCPV40HDRS michael@0: michael@0: ifeq ($(MOZ_OS2_HIGH_MEMORY),1) michael@0: HIGHMEM_LDFLAG = -Zhigh-mem michael@0: endif michael@0: michael@0: ifndef NO_SHARED_LIB michael@0: WRAP_MALLOC_LIB = michael@0: WRAP_MALLOC_CFLAGS = michael@0: DSO_CFLAGS = michael@0: DSO_PIC_CFLAGS = michael@0: MKSHLIB = $(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@ michael@0: MKCSHLIB = $(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@ michael@0: MKSHLIB_FORCE_ALL = michael@0: MKSHLIB_UNFORCE_ALL = michael@0: DSO_LDOPTS = -Zomf -Zdll -Zmap $(HIGHMEM_LDFLAG) michael@0: SHLIB_LDSTARTFILE = michael@0: SHLIB_LDENDFILE = michael@0: ifdef MAPFILE michael@0: MKSHLIB += $(MAPFILE) michael@0: endif michael@0: PROCESS_MAP_FILE = \ michael@0: echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@; \ michael@0: echo PROTMODE >> $@; \ michael@0: echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@; \ michael@0: echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@; \ michael@0: echo EXPORTS >> $@; \ michael@0: grep -v ';+' $< | grep -v ';-' | \ michael@0: sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \ michael@0: awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@ michael@0: michael@0: endif #NO_SHARED_LIB michael@0: michael@0: OS_CFLAGS = -Wall -Wno-unused -Wpointer-arith -Wcast-align -Wno-switch -Zomf -DDEBUG -DTRACING -g michael@0: michael@0: ifdef BUILD_OPT michael@0: ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) michael@0: OPTIMIZER += -Os -s michael@0: else michael@0: OPTIMIZER += -O2 -s michael@0: endif michael@0: DEFINES += -UDEBUG -U_DEBUG -DNDEBUG michael@0: DLLFLAGS = -DLL -OUT:$@ -MAP:$(@:.dll=.map) $(HIGHMEM_LDFLAG) michael@0: EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE $(HIGHMEM_LDFLAG) michael@0: OBJDIR_TAG = _OPT michael@0: else michael@0: #OPTIMIZER = -O+ -Oi michael@0: DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn michael@0: DLLFLAGS = -DEBUG -DLL -OUT:$@ -MAP:$(@:.dll=.map) $(HIGHMEM_LDFLAG) michael@0: EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE $(HIGHMEM_LDFLAG) michael@0: OBJDIR_TAG = _DBG michael@0: LDFLAGS = -DEBUG $(HIGHMEM_LDFLAG) michael@0: endif # BUILD_OPT michael@0: michael@0: # OS/2 use nsinstall that is included in the toolkit. michael@0: # since we do not wish to support and maintain 3 version of nsinstall in mozilla, nspr and nss michael@0: michael@0: ifdef BUILD_TREE michael@0: NSINSTALL_DIR = $(BUILD_TREE)/nss michael@0: else michael@0: NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall michael@0: endif michael@0: # NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall michael@0: NSINSTALL = nsinstall # HCT4OS2 michael@0: INSTALL = $(NSINSTALL) michael@0: michael@0: MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend michael@0: MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend michael@0: MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk michael@0: michael@0: #################################################################### michael@0: # michael@0: # One can define the makefile variable NSDISTMODE to control michael@0: # how files are published to the 'dist' directory. If not michael@0: # defined, the default is "install using relative symbolic michael@0: # links". The two possible values are "copy", which copies files michael@0: # but preserves source mtime, and "absolute_symlink", which michael@0: # installs using absolute symbolic links. michael@0: # - THIS IS NOT PART OF THE NEW BINARY RELEASE PLAN for 9/30/97 michael@0: # - WE'RE KEEPING IT ONLY FOR BACKWARDS COMPATIBILITY michael@0: #################################################################### michael@0: michael@0: ifeq ($(NSDISTMODE),copy) michael@0: # copy files, but preserve source mtime michael@0: INSTALL = $(NSINSTALL) michael@0: INSTALL += -t michael@0: else michael@0: ifeq ($(NSDISTMODE),absolute_symlink) michael@0: # install using absolute symbolic links michael@0: INSTALL = $(NSINSTALL) michael@0: INSTALL += -L `pwd` michael@0: else michael@0: # install using relative symbolic links michael@0: INSTALL = $(NSINSTALL) michael@0: INSTALL += -R michael@0: endif michael@0: endif michael@0: michael@0: define MAKE_OBJDIR michael@0: if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi michael@0: endef michael@0: michael@0: # michael@0: # override the definition of DLL_PREFIX in prefix.mk michael@0: # michael@0: michael@0: ifndef DLL_PREFIX michael@0: DLL_PREFIX = $(NULL) michael@0: endif michael@0: michael@0: # michael@0: # override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY michael@0: # michael@0: ifndef TARGETS michael@0: TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM) michael@0: endif michael@0: michael@0: michael@0: ifdef LIBRARY_NAME michael@0: IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)$(JDK_DEBUG_SUFFIX).lib michael@0: endif michael@0: