SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CXX = g++
  2. CXXFLAGS += -std=c++17
  3. SRCS = hello.cpp bye.cpp here.cpp
  4. OBJS = $(SRCS:.cpp=.o)
  5. TARGET_LIB = libmylib.a
  6. TARGET_EXE = output
  7.  
  8. .PHONY: all clean
  9.  
  10. all: $(TARGET_LIB) $(TARGET_EXE)
  11.  
  12. $(TARGET_EXE): main.o $(TARGET_LIB)
  13.     $(CXX) $(CXXFLAGS) -o $(TARGET_EXE) main.o -L. -lmylib
  14.  
  15. %.o: %.cpp
  16.     $(CXX) $(CXXFLAGS) -c $<
  17.  
  18. $(TARGET_LIB): $(OBJS)
  19.     ar cr $(TARGET_LIB) $(OBJS)
  20.  
  21. clean:
  22.     rm -f $(OBJS) $(TARGET_EXE) $(TARGET_LIB) main.o
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top