#  License
#  -------
#  No Copyright
#
#  The person who associated a work with this deed has dedicated the work to the
#  public domain by waiving all of his or her rights to the work worldwide under
#  copyright law, including all related and neighboring rights, to the extent
#  allowed by law.
#
#  You can copy, modify, distribute and perform the work, even for commercial
#  purposes, all without asking permission.
#
#  See https://creativecommons.org/share-your-work/public-domain/cc0/ for more
#  information on the license


#  Project
#  -------
#  This file is part of the keyboard project, made by
#  Maarten Tromp <maarten@geekabit.nl>.
#
#  More info on the project:
#  https://www.geekabit.nl/projects/building-a-keyboard-from-scratch/


TARGET		:= i2c_test
#LIBS		:= -lpthread -lm
LIBDIRS		:=
CXX		:= g++ -c
CXXFLAGS	+= -Wall -Wextra
#CXXFLAGS	+= -std=c99
#CXXFLAGS	+= -DDEBUG
#CXXFLAGS	+= -DNDEBUG
LD		:= g++
#LDFLAGS		+= -Wl,--verbose
SOURCES		:= main.c
#HEADERS		:= $(SOURCES:.c=.h)
#HEADERS		:= ledd.hpp
OBJECTS		:= $(SOURCES:.c=.o)
RMFLAGS		+= -v
INSTALLFLAGS	+= -v
#.SUFFIXES: .o .c
.PHONY: all clean install uninstall

# targets
.c.o:	$(HEADERS)
	$(CXX) -o $@ $(CXXFLAGS) $<

$(TARGET):	$(HEADERS) $(OBJECTS)
	$(LD) -o $@ $(LDFLAGS) $(OBJECTS) $(LIBDIRS) $(LIBS)

all:	$(TARGET)

clean: 
	-$(RM) $(OBJECTS) $(TARGET)

install:	$(TARGET)
	$(INSTALL) $(INSTALLFLAGS) -d $(BINDIR)
	$(INSTALL) $(INSTALLFLAGS) -m755 $(TARGET) $(BINDIR)

uninstall:
	-$(RM) $(RMFLAGS) $(BINDIR)/$(TARGET)


# end of file
