Skip to content

Instantly share code, notes, and snippets.

@pav67
Created August 4, 2014 13:24
Show Gist options
  • Save pav67/73f3fe9063e286831961 to your computer and use it in GitHub Desktop.
Save pav67/73f3fe9063e286831961 to your computer and use it in GitHub Desktop.
Makefile
GCC=gcc
RM=rm
SRC=$(wildcard *.c)
OBJ=$(SRC:.c=.o)
FLAGS=
EXEC=main
all : $(EXEC)
%.o : %.c
$(GCC) -c $^ -o $@
$(EXEC) : $(OBJ)
$(GCC) $^ -o $@ $(FLAGS)
.PHONY: clean
clean :
$(RM) *.o
$(RM) $(EXEC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment