## -*- Makefile -*-
##
## User: root
## Time: Apr 17, 2007 4:35:39 PM
## Makefile created by Sun Studio.
##
## This file is generated automatically.
##

#### Compiler and tool definitions shared by all build targets #####
CCC = CC
CXX = CC
BASICOPTS = -fast -xtarget=opteron -m64  -mt #-xa
CCFLAGS = $(BASICOPTS)  -I'/yacco2/o2linker' -I'/yacco2/compiler/grammars' -I'/yacco2/library/grammars' -I'/yacco2/library'
CXXFLAGS = $(BASICOPTS)
CCADMIN = CCadmin -clean

LDLIBS_o2 = -L '/yacco2/library/yacco2build/dist/Release/Sun12-Solaris-x86' -l yacco2 \
-L '/yacco2/compiler/grammars/o2grammarsbuild/dist/Release/Sun12-Solaris-x86' -l yacco2grammars
# Define the target directories.
TARGETDIR_linker=Sun-x86-Solaris

all: $(TARGETDIR_linker)/o2linker
## Target: linker
OBJS_linker =  $(TARGETDIR_linker)/o2linker.o\
	$(TARGETDIR_linker)/common_externs.o \
	$(TARGETDIR_linker)/yacco2_extn.o \
	$(TARGETDIR_linker)/o2linker_defs.o \
	$(TARGETDIR_linker)/yacco2_stbl.o

# Link or archive
$(TARGETDIR_linker)/o2linker: $(TARGETDIR_linker) $(OBJS_linker)
	$(LINK.cc) -z muldefs -z rescan $(CCFLAGS_linker) $(CPPFLAGS_linker) -o $@ $(OBJS_linker) $(LDLIBS_linker)
 

# Compile source files into .o files
$(TARGETDIR_linker)/common_externs.o: $(TARGETDIR_linker) common_externs.cpp
	$(COMPILE.cc) $(CCFLAGS_linker) $(CPPFLAGS_linker) -o $@ common_externs.cpp
$(TARGETDIR_linker)/yacco2_extn.o: $(TARGETDIR_linker) yacco2_extn.cpp
	$(COMPILE.cc) $(CCFLAGS_linker) $(CPPFLAGS_linker) -o $@ yacco2_extn.cpp

$(TARGETDIR_linker)/o2linker_defs.o: $(TARGETDIR_linker) o2linker_defs.cpp
	$(COMPILE.cc) $(CCFLAGS_linker) $(CPPFLAGS_linker) -o $@ o2linker_defs.cpp

$(TARGETDIR_linker)/o2linker.o: $(TARGETDIR_linker) o2linker.cpp
	$(COMPILE.cc) $(CCFLAGS_linker) $(CPPFLAGS_linker) -o $@ o2linker.cpp

%.cpp: %.w
	cweave o2linker.w
	ctangle -l +e o2linker.w
	cweave /yacco2/compiler/stbl/yacco2_stbl.w
	ctangle -l +e /yacco2/compiler/stbl/yacco2_stbl.w
	cweave o2linker_externs.w
	ctangle -l +e o2linker_externs.w
	cweave /yacco2/externals/common_externs.w
	cweave types.w
	ctangle -l +e types.w
	ctangle -l +e /yacco2/externals/common_externs.w
	sh Makefile_Edit_cweb

#### Clean target deletes all generated files ####
clean:
	rm -f \
		$(TARGETDIR_linker)/o2linker \
		$(TARGETDIR_linker)/o2linker_externs.o \
		$(TARGETDIR_linker)/yacco2_stbl.o \
		o2linker.cpp \
		o2linker.h \
		o2linker_externs.cpp \
		o2linker_externs.h \
		common_externs.cpp \
		common_externs.h \
		o2linker_defs.cpp \
		yacco2_stbl.h
	$(CCADMIN)
	rm -f -r $(TARGETDIR_linker)


# Create the target directory (if needed)
$(TARGETDIR_linker):
	mkdir -p $(TARGETDIR_linker)

# Enable dependency checking
.KEEP_STATE:
.KEEP_STATE_FILE:.make.state.Sun-x86-Solaris