diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /web/yacco2/library/makefile_APPLE |
Initial commit
Diffstat (limited to 'web/yacco2/library/makefile_APPLE')
-rw-r--r-- | web/yacco2/library/makefile_APPLE | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/web/yacco2/library/makefile_APPLE b/web/yacco2/library/makefile_APPLE new file mode 100644 index 0000000000..94232bfea2 --- /dev/null +++ b/web/yacco2/library/makefile_APPLE @@ -0,0 +1,85 @@ +# File: makefile_APPLE +# Why: Creates the library of yacco2: libyacco2.a +# or gens the code and pdf document +# Library placement: +# Rlse: /usr/local/yacco2/library/lib/Release +# Dbg: /usr/local/yacco2/library/lib/Debug +# `*.cpp' gen and pdf placement: +# Genw: for the pdf file: yacco2/docs +# for the *.cpp files: yacco2/library +# +# How to run: U must choose the label to execute: Rlse, Dbg, Genw +# Rlse --- gen the fast version of library: libyacco2.a +# Dbg --- gen the debug version of library: libyacco2.a +# 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 +# +# Example: gen the debug version of the library +# cd /usr/local//yacco2/library +# make Dbg -f makefile_APPLE +# +O2 := /usr/local/yacco2 +#CC := /opt/local/bin/c++-mp-4.9 +CC := clang++ #g++ +02_target_dir := +ifeq ($(MAKECMDGOALS),Rlse) +O2_target_dir := Release +Compile_opts := -c -pthread -arch x86_64 +else +O2_target_dir := Debug +Compile_opts := -g -c -pthread -arch x86_64 +endif + +### +# Set up directories +### +Base_o2 := $(O2) +O2_docs := $(Base_o2)/docs +O2_library := $(Base_o2)/library +O2_library_lib := $(O2_library)/lib +O2_lib_grms := $(O2_library)/grammars +O2_includes := -I'$(O2_library)' -I'$(O2_lib_grms)' + +### +# Objects to compile +## +Objects_to_compile:= $(patsubst %.cpp,%.o,$(wildcard *.cpp)) +Objects_for_lib:= wrc.o wtok_can.o wtree.o wthread.o wset.o yacco2.o +Objects_for_lib+= yacco2_characters.o yacco2_k_symbols.o + +### +# Compile, link, and move yacco2 library +### +Rlse: Compile Move_lib +Dbg: Compile Move_lib + +Move_lib: + rm -f $(O2_library_lib)/$(O2_target_dir)/libyacco2.a + libtool -static -arch_only x86_64 -o $(O2_library_lib)/$(O2_target_dir)/libyacco2.a $(Objects_for_lib) + rm -f $(Objects_for_lib) + +Compile: + $(CC) $(Compile_opts) $(O2_includes) wrc.cpp -o wrc.o + $(CC) $(Compile_opts) $(O2_includes) wtok_can.cpp -o wtok_can.o + $(CC) $(Compile_opts) $(O2_includes) wtree.cpp -o wtree.o + $(CC) $(Compile_opts) $(O2_includes) wthread.cpp -o wthread.o + $(CC) $(Compile_opts) $(O2_includes) wset.cpp -o wset.o + $(CC) $(Compile_opts) $(O2_includes) yacco2.cpp -o yacco2.o + $(CC) $(Compile_opts) $(O2_includes) $(O2_lib_grms)/yacco2_characters.cpp -o yacco2_characters.o + $(CC) $(Compile_opts) $(O2_includes) $(O2_lib_grms)/yacco2_k_symbols.cpp -o yacco2_k_symbols.o +Genw: + cweave wlibrary + pdftex wlibrary + ctangle -l +e wlibrary + sh Makefile_Edit_cweb + mv wlibrary.pdf $(O2_docs) + rm wlibrary.idx + rm wlibrary.scn + rm wlibrary.toc + rm wlibrary.tex + rm wlibrary.log + rm wlibrary.c |