Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CC ?= gcc
- CFLAGS ?= -pipe -Wall -Werror
- CLIBS ?= -lpthread
- TARGET ?= main
- SRC := $(wildcard *.c)
- OBJ := $(patsubst %.c,%.o,$(SRC))
- .PHONY: all debug release clean clean-objs
- .DEFAULT_GOAL := release
- debug: CFLAGS += -O0 -ggdb3
- debug: $(TARGET) clean-objs
- release: CFLAGS += -O3
- release: $(TARGET) clean-objs
- $(TARGET): $(OBJ)
- $(CC) $(OBJ) -o $(TARGET) $(CLIBS)
- %.o: %.c
- $(CC) $(CFLAGS) $(CLIBS) -c $< -o $@
- clean: clean-objs
- @rm $(TARGET)
- clean-objs:
- @rm -f *.o
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement