Advertisement
Phr0zen_Penguin

General-Purpose Makefile

Dec 25th, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.43 KB | None | 0 0
  1. # Compiler variable:
  2. CC=g++
  3.  
  4. # Compiler flags/options variable:
  5. CFLAGS=-c -Wall
  6.  
  7. # Linker flags/options variable:
  8. LDFLAGS=-s
  9.  
  10. # Source files variable:
  11. SOURCES=main.cpp hello.cpp functions.cpp
  12.  
  13. # Object files variable:
  14. OBJECTS=$(SOURCES:.cpp=.o)
  15.  
  16. # Executable variable:
  17. EXECUTABLE=hello
  18.  
  19. all: $(SOURCES) $(EXECUTABLE)
  20.  
  21. $(EXECUTABLE): $(OBJECTS)
  22.     $(CC) $(LDFLAGS) $(OBJECTS) -o $@
  23.  
  24. .cpp.o:
  25.     $(CC) $(CFLAGS) $< -o $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement