Skip to content

Instantly share code, notes, and snippets.

@fearofcode
Created March 13, 2016 01:43
Show Gist options
  • Save fearofcode/ff7b06fbdf9de3b54b58 to your computer and use it in GitHub Desktop.
Save fearofcode/ff7b06fbdf9de3b54b58 to your computer and use it in GitHub Desktop.
simple makefile showing syntax for using extra libraries and useful warning flags
all: lc gmmc
CC=gcc
CFLAGS= -g -m64 -O3 -std=gnu11 -Wall -Werror -Wextra -Wshadow -pedantic \
-Wextra -Wunknown-pragmas -Wfloat-equal -Wcast-qual
LDLIBS= -lgsl -lgslcblas -lm
lc: learning_c.c
$(CC) $(CFLAGS) -o $@ learning_c.c
gmmc: golden_monkey_monte_carlo.c
$(CC) $(CFLAGS) -o $@ golden_monkey_monte_carlo.c $(LDLIBS)
clean:
rm gmmc
rm lc
rm *.s
rm *.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment