# Compiler/linker setup ------------------------------------------------------

# Mac OS X-specific flags.  Comment these out if using Linux.
#PLATFORM = osx
#CC       = gcc
#CFLAGS   = -fast -Wall
#OSLIBS   = -Wl,-framework -Wl,IOKit
#LDFLAGS  =

# Linux-specific flags.  Comment these out if using Mac OS X.
PLATFORM = linux
CC       = gcc
CFLAGS   = -O3 -Wall 
OSLIBS   =
LDFLAGS  =

# make all: all OBJS are compiled and executable available
# make <individual>
# make clean
# TODO: find out why -lpthread does not work when put into CFLAGS
# Example programs -----------------------------------------------------------

OBJS = saxpy_ex
all: $(OBJS)

saxpy_ex: saxpy_ex.c saxpy_fun.o
	$(CC) $(CFLAGS) -o saxpy_ex saxpy_ex.c saxpy_fun.o -lm

# library
saxpy_fun.o: saxpy_fun.c saxpy_fun.h
	$(CC) $(CFLAGS) -c saxpy_fun.c -lm # -o saxpy_fun.o --> this seems implied here when
                                  #                   using 'func.o' as label

# Maintenance and stuff ------------------------------------------------------
clean:
	rm -f $(OBJS) *.o core


