Open source packages
magic spell to install open source packages
./configure
make
sudo make install
command "configure" checks for all the needed dependency.
command "make" build package with makefile and outputs .o file.
after command "sudo make install" you can use hello package.
GNU autotools
m4 = macros , circled words are command.
myexe = executable name
will use automake for this project
gcc ,cl ,cc / any compiler will be fine
Makefile.in -> makefile
acolocal.m4 and configure are generated.
by foreign it will not work as GNU standards.
by command "automake --add-missing" makefile.am generated makefile.in
and than we type command "./configure" and then "make dist" we will get myexe-1.0.tar.gz
Cmake
a cross platform Makefile generator.
CMakeLists.txt is the only file we need to write in order to make cmake work.
by make build directory
- all the generated files are seperated from source file
- can have several build tree for same source tree
- can perform clean build
with "cmake --help-command proejct" we can check what is project keyword.
include_directories = where to look for inlcude file.
link_directories = where to look for library.
set = create variable in this case SOURCE
add executable = create executable named myexe in the followling directory.
target_link_libraries = first executable and then following is libraries. same as command "gcc -l".
install = myexe will be installed in /usr/bin
after "cmake" , inside build folder Makefile is created. and with "make" we can use our myexe exectuable.
there are other things like "cpack --config CPackSourceConfig.cmake". and will create packages with many distribution type.
'Operating System > System Programming(Arif Butt)' 카테고리의 다른 글
Lec08) Exit Handlers and Resource Limits (0) | 2021.06.18 |
---|---|
Lec 6, 7) Versioning Systems git-1,2 (0) | 2021.06.15 |
Lec04) UNIX make utility (0) | 2021.06.12 |
Lec03) Working of Linkers: Creating your own Libraries (0) | 2021.06.11 |
Lec02) C Compilation: A System Programmer Perspective (0) | 2021.06.09 |