Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.90 KB | None | 0 0
  1. # Обычные дефайн
  2. CXX=g++
  3. CXXFLAGS=-std=c++17
  4.  
  5. all:
  6.     @echo "!-----------------Homework presentation-------------------!"
  7.     @echo "------------------Create static library--------------------"
  8.     make mylib.a
  9.     @echo "------------------Create .exe from static library----------"
  10.     make startStaticLib.exe
  11.     @echo "------------------Temporary files--------------------------"
  12.     dir
  13.     @echo "------------------Run .exe static library------------------"
  14.     ./startStaticLib.exe
  15.     @echo "------------------Clean files------------------------------"
  16.     make clean
  17.     @echo "------------------Temporary files--------------------------"
  18.     dir
  19.     @echo "------------------Create dinamic library-------------------"
  20.     make libmylib.so.5
  21.     @echo "------------------Temporary files--------------------------"
  22.     dir
  23.     @echo "------------------Clean files------------------------------"
  24.     make clean
  25.     @echo "!----------------------The End----------------------------!"
  26.    
  27. libmylib.so.5: all.o
  28.     $(CXX) $(CXXFLAGS) -shared -L -Wl,-soname=libmylib.so.5 -o libmylib.so.5.1.10 hello.o here.o bye.o
  29.        
  30. # НАДО УЗНАТЬ РАЗНИЦУ: "rvs" ?= "cr" ?= "rcs" ?= "rv"
  31. mylib.a: all.o
  32.     ar rv mylib.a here.o hello.o bye.o
  33.  
  34. start.exe: STAT clean.o
  35.     $(CXX) $(CXXFLAGS) -o start main.cpp mylib.a
  36.    
  37. startDefine.exe:
  38.     $(CXX) $(CXXFLAGS) -o startDefine -DNAME=\"Denis\" main.cpp hello.cpp here.cpp bye.cpp 
  39.    
  40. startStaticLib.exe: mylib.a
  41.     $(CXX) $(CXXFLAGS) -o startStaticLib main.cpp mylib.a
  42.  
  43. all.o: hello.o here.o bye.o
  44.  
  45. main.o: main.cpp
  46.     $(CXX) $(CXXFLAGS) -c -fPIC main.cpp
  47.  
  48. hello.o: hello.cpp
  49.     $(CXX) $(CXXFLAGS) -c -fPIC hello.cpp
  50.  
  51. here.o: here.cpp
  52.     $(CXX) $(CXXFLAGS) -c -fPIC here.cpp   
  53.    
  54. bye.o: bye.cpp
  55.     $(CXX) $(CXXFLAGS) -c -fPIC bye.cpp
  56.  
  57. clean: clean.o clean.a clean.exe clean.so
  58.        
  59. clean.o:
  60.     rm -rf *.o  
  61.    
  62. clean.a:
  63.     rm -rf *.a
  64.    
  65. clean.exe:
  66.     rm -rf *.exe
  67.    
  68. clean.so:
  69.     rm -rf libmylib.*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement