SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CC ?= gcc
  2. CFLAGS ?= -pipe -Wall -Werror
  3. CLIBS ?= -lpthread
  4.  
  5. TARGET ?= main
  6. SRC := $(wildcard *.c)
  7. OBJ := $(patsubst %.c,%.o,$(SRC))
  8.  
  9.  
  10. .PHONY: all debug release clean clean-objs
  11. .DEFAULT_GOAL := release
  12.  
  13.  
  14. debug: CFLAGS += -O0 -ggdb3
  15. debug: $(TARGET) clean-objs
  16.  
  17. release: CFLAGS += -O3
  18. release: $(TARGET) clean-objs
  19.  
  20. $(TARGET): $(OBJ)
  21.     $(CC) $(OBJ) -o $(TARGET) $(CLIBS)
  22.  
  23. %.o: %.c
  24.     $(CC) $(CFLAGS) $(CLIBS) -c $< -o $@
  25.  
  26. clean: clean-objs
  27.     @rm $(TARGET)
  28.  
  29. clean-objs:
  30.     @rm -f *.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