CC = gcc
NAME = broccoli

# Assumes you have a directory ezdraw at the top of your directory structure
# that contains the ezdraw.h and libezdraw.a files
IDIR = ~/ezdraw/
LDIR = ~/ezdraw/

#libraries to load
LIBS = -lezdraw -lm

# Warnings frequently signal eventual errors:
CFLAGS=`sdl2-config --cflags` -g -W -Wall -Wextra -pedantic -O0 -I `sdl2-config --prefix`/include/

LDFLAGS = `sdl2-config --libs`

OBJS = $(NAME).o

$(NAME): $(NAME).o $(LDIR)libezdraw.a
	$(CC) -o $(NAME) $(NAME).o $(CFLAGS) -L $(LDIR) $(LIBS) $(LDFLAGS)

$(NAME).o: $(NAME).c $(IDIR)ezdraw.h
	$(CC) $(CFLAGS) -I $(IDIR) -c $< -o $@

clean:
	rm -f *.o
	rm -f *~
	rm -f $(NAME)
