diff options
Diffstat (limited to 'web/yacco2/o2linker/makefile_GNU')
-rw-r--r-- | web/yacco2/o2linker/makefile_GNU | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/web/yacco2/o2linker/makefile_GNU b/web/yacco2/o2linker/makefile_GNU new file mode 100644 index 0000000000..12067d8a97 --- /dev/null +++ b/web/yacco2/o2linker/makefile_GNU @@ -0,0 +1,82 @@ +# File: makefile_GNU +# Why: Creates the o2linker companion to o2 compiler /compiler +# Library placement: +# Rlse: /usr/local/yacco2/bin/o2linker +# Dbg: /usr/local/yacco2/bin/o2linker_dbg +# 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 +# +# Example: gen the debug version of the library +# cd /usr/local/yacco2/compiler/grammars +# make Dbg -f Solaris_makefile +# +CC := g++ + +02_target_dir := +ifeq ($(MAKECMDGOALS),Rlse) +O2_target_dir := Release +else +O2_target_dir := Debug +endif + +Base_yacco2 := $(O2) +O2_bin := $(Base_yacco2)/bin +O2_eternals := $(Base_yacco2)/externals +O2_docs := $(Base_yacco2)/docs +O2_lib := $(Base_yacco2)/library +O2_lib_grms := $(Base_yacco2)/library/grammars +O2_cc_grms := $(Base_yacco2)/compiler/grammars +O2_cc := $(Base_yacco2)/compiler/o2 +O2_includes := -I'$(O2_cc)' -I'$(O2_cc_grms)' -I'$(O2_lib)' -I'$(O2_lib_grms)' +O2_req_libraries := -lyacco2 -lo2grammars +O2_lib_directories := -L$(O2_cc_grms)/lib/$(O2_target_dir) -L$(O2_lib)/lib/$(O2_target_dir) + +### +# Set up c++ compiler and ld linker options +### +Rlse: Compile_opts := -c -O3 -pthread +Dbg: Compile_opts := -c -g -pthread +Link_opts := -Wl,-z -Wl,muldefs -Wl,-Ur #$(O2_lib_directories) +Multi_rd_libs := -static-libgcc -Wl,--start-group -lyacco2 -lo2grammars -Wl,--end-group -lpthread + +### +# Compile, link, and move O2linker into bin account +### +Rlse: YYY Move_rlse_o2linker +Dbg: YYY Move_dbg_o2linker +YYY: + $(CC) -v $(Compile_opts) o2linker.cpp -o o2linker.o $(O2_includes) + $(CC) -v $(Compile_opts) common_externs.cpp -o common_externs.o $(O2_includes) + $(CC) -v $(Compile_opts) o2linker_externs.cpp -o o2linker_externs.o $(O2_includes) + $(CC) -v $(Compile_opts) o2linker_defs.cpp -o o2linker_defs.o $(O2_includes) + ld '-o' 'o2linker' '-shared-libgcc' '-mtune=generic'\ + --eh-frame-hdr -m elf_i386 --hash-style=both -dynamic-linker\ + /lib/ld-linux.so.2 -o o2linker -z relro /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crt1.o\ + /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.2/crtbegin.o\ + -L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2\ + -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib\ + -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../..\ + $(O2_lib_directories) o2linker_externs.o o2linker_defs.o common_externs.o o2linker.o\ + --whole-archive -lyacco2 --no-whole-archive -start-group -lo2grammars --end-group -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc\ + -lpthread /usr/lib/gcc/i486-linux-gnu/4.3.2/crtend.o\ + /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crtn.o + +Move_rlse_o2linker: + mv o2linker $(O2_bin) + rm *.o +Move_dbg_o2linker: + mv o2linker o2linker_dbg + mv o2linker_dbg $(O2_bin) + rm o2linker + rm *.o + |