Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Обычные дефайн
- CXX=g++
- CXXFLAGS += -std=c++17
- all:
- @echo "-----Homework presentation-----"
- DYN: all.o
- $(CXX) $(CXXFLAGS) -shared -L -Wl,-soname=libmylib.so.5 -o libmylib.so.5.1.10 hello.o here.o bye.o
- # Static library creator
- # НАДО УЗНАТЬ РАЗНИЦУ: "rvs" ?= "cr" ?= "rcs" ?= "rv"
- mylib.a: all.o
- ar rv mylib.a here.o hello.o bye.o
- # Create executable file
- start.exe: STAT clean.o
- $(CXX) -o start main.cpp mylib.a
- # Create executable file with define
- startDefine.exe:
- $(CXX) $(CXXFLAGS) -o startDefine -DNAME=\"Denis\" main.cpp hello.cpp here.cpp bye.cpp
- # Create executable file from static library
- startStaticLib.exe: mylib.a
- $(CXX) $(CXXFLAGS) -o startStaticLib main.cpp mylib.a
- # Object file creators
- # "-fPIC" for inclusion in a library
- 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
- # File cleaners
- 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