# # # Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it would be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Further, this software is distributed without any warranty that it is # free of the rightful claim of any third person regarding infringement # or the like. Any license provided herein, whether implied or # otherwise, applies only to this software file. Patent licenses, if # any, provided herein do not apply to combinations of this program with # other software, or any other product whatsoever. # # You should have received a copy of the GNU General Public License along # with this program; if not, write the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston MA 02111-1307, USA. # # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, # Mountain View, CA 94043, or: # # http://www.sgi.com # # For further information regarding this notice, see: # # http://oss.sgi.com/projects/GenInfo/NoticeExplan # # # # Makefile.base for gcc-based driver # include $(COMMONDEFS) # setup stuff to build shared or non-shared LCOPTS = $(STD_COMPILE_OPTS) GLDOPTS = $(STD_LOAD_OPTS) ifeq ($(BUILD_TARGET), IA64) LCDEFS += -DIA64 endif ifeq ($(BUILD_TARGET), IA32) LCDEFS += -DIA32 endif ifeq ($(BUILD_TARGET), MIPS) LCDEFS += -DMIPS endif ifeq ($(BUILD_HOST), IA32) ifeq ($(BUILD_VARIANT), NUE) # NUE is special environment built on ia32 but looks like ia64 LCDEFS += -DLITTLE_ENDIAN_HOST -DHOST_IA64 else LCDEFS += -DLITTLE_ENDIAN_HOST -DHOST_IA32 endif endif ifeq ($(BUILD_HOST), IA64) LCDEFS += -DLITTLE_ENDIAN_HOST -DHOST_IA64 endif ifeq ($(BUILD_HOST), MIPS) LCDEFS += -DHOST_MIPS endif RUN = ifeq ($(BUILD_ARCH), IA64) ifeq ($(BUILD_HOSTARCH), IA32) RUN = medusa -batch endif endif ifeq ($(BUILD_VARIANT), NOOPT) # special driver for no optimization LCDEFS += -DNOOPT endif ifeq ($(BUILD_VARIANT), NUE) # special driver for NUE cross environment LCDEFS += -DNUE endif ifeq ($(BUILD_VARIANT), LICENSING) # special driver for no optimization LCDEFS += -DCOMPILER_LICENSING LDLIBS += -llmsgi endif # don't want to use common/com/defs.h ifeq ($(BUILD_OS), LINUX) LCINCS = -I. -I$(BUILD_BASE) -I$(BUILD_AREA)/include else LCINCS = -I. -I$(BUILD_BASE) -I$(BUILD_TOT)/include endif TARGETS = driver # generated header files (including .i files) GEN_HFILES = \ option_names.h \ init_options.i \ get_option.i \ opt_action.i SHARED_HFILES = \ basic.h \ errors.h \ file_utils.h \ lang_defs.h \ string_utils.h SRC_HFILES = \ config_platform.h \ options.h \ option_seen.h \ opt_actions.h \ get_options.h \ file_names.h \ objects.h \ phases.h \ run.h HFILES= \ $(SHARED_HFILES) \ $(SRC_HFILES) \ $(GEN_HFILES) GEN_CFILES = \ check_combos.c \ implicits.c SHARED_CFILES = \ errors.c \ file_utils.c \ lang_defs.c \ string_utils.c SRC_CFILES = \ main.c \ options.c \ option_seen.c \ config_platform.c \ get_options.c \ opt_actions.c \ file_names.c \ objects.c \ phases.c \ run.c \ special_options.c CFILES= \ $(SHARED_CFILES) \ $(GEN_CFILES) \ $(SRC_CFILES) OPTIONS_SRC = \ OPTIONS \ sort_options.csh \ sort_options.awk SRC_OBJECTS = $(SRC_CFILES:.c=.o) SHARED_OBJECTS = $(SHARED_CFILES:.c=.o) LDIRT = OPTIONS.P table generated $(GEN_HFILES) $(GEN_CFILES) LANGS = as cc c89 CC f77 fort77 f90 default: first $(TARGETS) last first: ifeq ($(BUILD_OS), LINUX) cd $(BUILD_AREA)/include && $(MAKE) endif last: make_deps ifeq ($(BUILD_VARIANT), NO_LICENSE) install: default ifndef NOSYSGEN $(STD_INSTALL) -F /usr/cpu/sysgen/root/usr/bin -src driver cc endif endif ifeq ($(BUILD_TARGET), MIPS) install: default $(STD_INSTALL) $(STD_INSTALL_EXEC_MASK) -F $(STD_MONGOOSE_LOC) driver $(STD_INSTALL) -lns driver -F $(STD_MONGOOSE_LOC) $(LANGS) # assume that 3.19 installed driverwrap, but need new f90 $(STD_INSTALL) -lns ../lib/driverwrap -F /usr/bin f90 $(STD_INSTALL) -lns driver -F /usr/lib f90 else # IA32 or IA64 install: default $(STD_INSTALL) $(STD_INSTALL_EXEC_MASK) -D driver $(STD_MONGOOSE_LINUX_LOC)/driver rm -f $(STD_MONGOOSE_LINUX_LOC)/sgicc $(STD_MONGOOSE_LINUX_LOC)/sgiCC rm -f $(STD_MONGOOSE_LINUX_LOC)/sgif90 ln -s $(STD_MONGOOSE_LINUX_LOC)/driver $(STD_MONGOOSE_LINUX_LOC)/sgicc ln -s $(STD_MONGOOSE_LINUX_LOC)/driver $(STD_MONGOOSE_LINUX_LOC)/sgiCC ln -s $(STD_MONGOOSE_LINUX_LOC)/driver $(STD_MONGOOSE_LINUX_LOC)/sgif90 endif include $(COMMONRULES) VPATH = $(BUILD_BASE) $(GEN_CFILES) $(GEN_HFILES) : generated generated : OPTIONS.P table $(RUN) ./table < OPTIONS.P touch generated table : table.o $(SHARED_OBJECTS) $(CCF) -o $@ table.o $(SHARED_OBJECTS) $(LDFLAGS) # invoke shell script in source tree, but put output here OPTIONS.P : $(OPTIONS_SRC) ifeq ($(filter IRIX SUNOS,$(BUILD_OS)), $(BUILD_OS)) $(BUILD_BASE)/sort_options.csh $(BUILD_BASE) OPTIONS $(LCDEFS) > OPTIONS.P || rm -f OPTIONS.P else ifeq ($(BUILD_OS), OSX) $(BUILD_BASE)/sort_options.osx.csh $(BUILD_BASE) OPTIONS $(LCDEFS) > OPTIONS.P || rm -f OPTIONS.P else ifeq ($(BUILD_OS), AIX) $(BUILD_BASE)/sort_options.aix.csh $(BUILD_BASE) OPTIONS $(LCDEFS) > OPTIONS.P || rm -f OPTIONS.P else $(BUILD_BASE)/sort_options.linux.csh $(BUILD_BASE) OPTIONS $(LCDEFS) > OPTIONS.P || rm -f OPTIONS.P endif endif endif driver: $(OBJECTS) $(CCF) -o $@ $(OBJECTS) $(LDFLAGS) # need to make generated headers before compiling src files $(SRC_OBJECTS) : $(GEN_HFILES)