PROG	= ass4

CC		= gcc
CFLAGS	= -std=c99 -pedantic -Wall -Wextra -D_GNU_SOURCE # -D_POSIX_SOURCE
LFLAGS	= -lpthread
OFILES	= main.o
RM		= rm -f

ifdef DEBUG
	CFLAGS +=-ggdb
else
	CFLAGS +=-O3
endif

$(PROG): $(OFILES)
	$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OFILES)

%.o: %.c
	$(CC) $(CFLAGS) -o $@ -c $<

clean:
	$(RM) $(OFILES) $(PROG)
