CC = gcc
###############################################################################################
# Use the following symbols for normal operation
LDFLAGS = -lpthread -lpigpio -lm
CFLAGS = -O3 -Wall -Wextra -std=gnu11

# Use the following when debugging to compile in backtrace capabilities
#LDFLAGS = -lpthread -lpigpiod_if2 -lrt -rdynamic
#CFLAGS = -Og -g -Wall -Wextra -funwind-tables -DDEBUG
###############################################################################################
all: test_sine_wave_output test_pigpio
###############################################################################################
test_sine_wave_output.o : test_sine_wave_output.c
	-$(CC) -c test_sine_wave_output.c -o $@ $(CFLAGS)
###############################################################################################
test_sine_wave_output : test_sine_wave_output.o
	-$(CC) test_sine_wave_output.o -o $@ $(LDFLAGS)
	-chmod 755 test_sine_wave_output
###############################################################################################
test_pigpio.o : test_pigpio.c
	-$(CC) -c test_pigpio.c -o $@ $(CFLAGS)
###############################################################################################
test_pigpio : test_pigpio.o
	-$(CC) test_pigpio.o -o $@ $(LDFLAGS)
	-chmod 755 test_pigpio
###############################################################################################
clean:
	-rm -f *.o *~ test_sine_wave_output test_pigpio
