I have Makefile
default_target: all
.PHONY : default_target
all: c11parser
clean:
rm -r build
.PHONY : clean
c11parser: build/c11main.o build/C11
c++ -o c11parser build/c11main.o -Ithirdparty/cpp_runtime/runtime/src build/C11/C11Lexer.o build/C11/C11Parser.o -lantlr4-runtime -Lthirdparty/cpp_runtime/dist -Wl,-rpath=thirdparty/cpp_runtime/dist
build/c11main.o: c11main.cpp build/C11/gen
c++ -c c11main.cpp -o build/c11main.o -Ithirdparty/cpp_runtime/runtime/src -Ibuild/C11/gen
build/C11: build/C11/gen
c++ -c build/C11/gen/C11Lexer.cpp -o build/C11/C11Lexer.o -Ithirdparty/cpp_runtime/runtime/src
c++ -c build/C11/gen/C11Parser.cpp -o build/C11/C11Parser.o -Ithirdparty/cpp_runtime/runtime/src
build/C11/gen: C11.g4
java -jar thirdparty/antlr/antlr-4.12.0-complete.jar -Werror -Dlanguage=Cpp -listener -visitor -o build/C11/gen -package C11 C11.g4
Tool Antlr4 generates classes in build/C11/gen directory.
C++ runtime library has both, shared and static libraries in directory thirdparty/cpp_runtime/dist:
-rw-rw-r-- 1 andrzej andrzej 2920088 Apr 5 13:43 libantlr4-runtime.a
-rwxrwxr-x 1 andrzej andrzej 1514240 Apr 5 13:43 libantlr4-runtime.so
-rwxrwxr-x 1 andrzej andrzej 1514240 Apr 5 13:43 libantlr4-runtime.so.4.12.0
Tool Antrl4 generates files from grammar.
- How to choose static, not shared library?
- How to generate executable already striped
- Striped parsed has 700K although has shared library , why so big?
- I have commands: c++ -c path1/file.cpp -o path2/file.o, it is inefficient to call compiler for creating one object file, but because path1 is not path2, I must. Better will without -o, results in the same folder, next move object file to other folder?