# File: makefile_SOLARIS # Why: Creates the o2 compiler /compiler # Library placement: # Rlse: /usr/local/yacco2/bin/o2 # Dbg: /usr/local/yacco2/bin/o2_debug # Genw: for the pdf file: yacco2/docs # for the *.cpp files # # How to run: U must choose the label to execute: Rlse, Dbg # Rlse --- gen the fast version of library with no debug support # Dbg --- gen the debug version of library # Genw --- gen the pdf document and the cpp code # from cweb see www.tug.org for details on obtaining code # for the literate programming environment aka CWEB # and please join Tug. It is a marvalous FOSS # Note: U do not need to use Genw as *.cpp and pdf # document are included in the ``yacco2'' package # Notice: Some possible construction to be done # 1) Adjust base_dir variable if the ``yacco2'' package is moved elsewhere. # For example, if u installed the ``yacco2'' package in /opt/yacco2 # Set the base_dir variable in this file to: base_dir = /opt/ # The trailing / must be there or ugly things will happen. # # Example: gen the debug version of the library # cd /usr/local/yacco2/compiler/o2 # make Dbg -f Solaris_makefile # O2 := /usr/local/yacco2 Rlse: BASICOPTS := -fast -c -m64 -lpthread Rlse: Bld_BASICOPTS := -m64 -lpthread Dbg: BASICOPTS := -c -m64 -lpthread -xs -g Dbg: Bld_BASICOPTS := -m64 -lpthread -xs -g o2_lib := $(O2)/library/ o2_stbl := $(O2)/compiler/stbl/ o2_docs := $(O2)/docs/ o2_lib_grms := $(O2)/library/grammars/ o2_grms := $(O2)/compiler/grammars/ o2 := $(O2)/compiler/o2/ O2_includes := -I'$(o2)' -I'$(o2_grms)' -I'$(o2_lib)' -I'$(o2_lib_grms)' o2_req_libraries := -lyacco2 -lo2grammars Rlse: o2_lib_directories := -L $(o2_grms)lib/Release/ -L $(o2_lib)lib/Release/ Dbg: o2_lib_directories := -L $(o2_grms)lib/Debug/ -L $(o2_lib)lib/Debug/ files_to_cc := \ o2_defs.cpp \ common_externs.cpp \ o2_externs.cpp \ o2.cpp files_to_o := $(files_to_cc:.cpp=.o) Rlse: Compile Rlse_o2 Rlse_o2: mv o2prg $(base_dir)yacco2/bin/o2 rm -f *.o Dbg: $(files_to_o) Dbg_o2 Dbg_o2: mv o2prg $(base_dir)yacco2/bin/o2_debug rm -f *.o Compile: $(files_to_o) common_externs.o: common_externs.cpp CC $(BASICOPTS) $(O2_includes) common_externs.cpp -o $@ o2_externs.o: o2_externs.cpp CC $(BASICOPTS) $(O2_includes) o2_externs.cpp -o $@ o2_defs.o: o2_defs.cpp CC $(BASICOPTS) $(O2_includes) o2_defs.cpp -o $@ o2.o: o2.cpp CC $(Bld_BASICOPTS) $(O2_includes) o2.cpp -o o2prg \ o2_defs.o common_externs.o o2_externs.o \ $(o2_lib_directories) $(o2_req_libraries) Genw: cweave types.w ctangle -l +e types.w pdftex types pdftops types.pdf mv types.pdf $(o2_docs) mv types.ps $(o2_docs) cweave common_externs.w ctangle -l +e common_externs.w pdftex common_externs pdftops common_externs.pdf mv common_externs.pdf $(o2_docs) mv common_externs.ps $(o2_docs) cweave o2externs.w ctangle -l +e o2externs.w pdftex o2externs pdftops o2externs.pdf mv o2externs.pdf $(o2_docs) mv o2externs.ps $(o2_docs) cweave o2.w ctangle -l +e o2.w sh Makefile_Edit_cweb pdftex o2 pdftops o2.pdf mv o2.pdf $(o2_docs) mv o2.ps $(o2_docs) rm types.idx rm types.scn rm types.toc rm types.tex rm types.log rm types.c rm common_externs.idx rm common_externs.scn rm common_externs.toc rm common_externs.tex rm common_externs.log rm common_externs.c rm o2externs.idx rm o2externs.scn rm o2externs.toc rm o2externs.tex rm o2externs.log rm o2externs.c rm o2.idx rm o2.scn rm o2.toc rm o2.tex rm o2.log rm o2.c