Skip to content

Instantly share code, notes, and snippets.

@hduffddybz
Last active August 29, 2015 14:08
Show Gist options
  • Save hduffddybz/82bc9a11a1eef8467466 to your computer and use it in GitHub Desktop.
Save hduffddybz/82bc9a11a1eef8467466 to your computer and use it in GitHub Desktop.
the universal usage of Makefile
SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c = .o)
CC = gcc
CCFLAGS = -g -Wall -O0
target = ringBuffer_test
$(target): $(OBJS)
$(CC) $^ -o $@ $(CCFLAGS)
%.o : %.c
$(CC) -c $< $(CCFLAGS)
clean:
rm $(OBJS) $(target)
.PHONY:clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment