Skip to content

Instantly share code, notes, and snippets.

@isilence
Created June 20, 2016 00:02
Show Gist options
  • Save isilence/6991b24b9e6e3e358272108e5d467e17 to your computer and use it in GitHub Desktop.
Save isilence/6991b24b9e6e3e358272108e5d467e17 to your computer and use it in GitHub Desktop.
CC = g++
LD = g++
CFLAGS = -O3 -std=c++11
# LDFLAGS
files = $(shell find ./ -type f -name '*.c')
program: $(patsubst %.c, %.o, $(files))
$(LD) $(LDFLAGS) -o solution $^
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
.PRONY: clean
clean:
rm $(patsubst %.c, %.o, $(files))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment