Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Обычные дефайн
- CXX=g++
- CXXFLAGS=-std=c++17
- all:
- @echo "!-----------------Homework presentation-------------------!"
- @echo "------------------Create static library--------------------"
- make mylib.a
- @echo "------------------Create .exe from static library----------"
- make startStaticLib.exe
- @echo "------------------Temporary files--------------------------"
- dir
- @echo "------------------Run .exe static library------------------"
- ./startStaticLib.exe
- @echo "------------------Clean files------------------------------"
- make clean
- @echo "------------------Temporary files--------------------------"
- dir
- @echo "------------------Create dinamic library-------------------"
- make libmylib.so.5
- @echo "------------------Temporary files--------------------------"
- dir
- @echo "------------------Clean files------------------------------"
- make clean
- @echo "!----------------------The End----------------------------!"
- libmylib.so.5: all.o
- $(CXX) $(CXXFLAGS) -shared -L -Wl,-soname=libmylib.so.5 -o libmylib.so.5.1.10 hello.o here.o bye.o
- # НАДО УЗНАТЬ РАЗНИЦУ: "rvs" ?= "cr" ?= "rcs" ?= "rv"
- mylib.a: all.o
- ar rv mylib.a here.o hello.o bye.o
- start.exe: STAT clean.o
- $(CXX) $(CXXFLAGS) -o start main.cpp mylib.a
- startDefine.exe:
- $(CXX) $(CXXFLAGS) -o startDefine -DNAME=\"Denis\" main.cpp hello.cpp here.cpp bye.cpp
- startStaticLib.exe: mylib.a
- $(CXX) $(CXXFLAGS) -o startStaticLib main.cpp mylib.a
- all.o: hello.o here.o bye.o
- main.o: main.cpp
- $(CXX) $(CXXFLAGS) -c -fPIC main.cpp
- hello.o: hello.cpp
- $(CXX) $(CXXFLAGS) -c -fPIC hello.cpp
- here.o: here.cpp
- $(CXX) $(CXXFLAGS) -c -fPIC here.cpp
- bye.o: bye.cpp
- $(CXX) $(CXXFLAGS) -c -fPIC bye.cpp
- clean: clean.o clean.a clean.exe clean.so
- clean.o:
- rm -rf *.o
- clean.a:
- rm -rf *.a
- clean.exe:
- rm -rf *.exe
- clean.so:
- rm -rf libmylib.*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement