
# Warn all - always use this to make the compiler really picky (and thus more helpful) 
CFLAGS += -Wall

#include debugging symbols - always use this or your debugger doesn't work! 
CFLAGS += -g

CFLAGS += -I.
LINKER_FLAGS += `pkg-config --libs gtk+-3.0` -rdynamic -lm

CFLAGS += `pkg-config --cflags gtk+-3.0`

#OBJS = 	main.o entry.o 
TARGET =	ToolbarBug

SOURCES = main.c

# .o files have same name as .cpp files
OBJS = $(SOURCES:%.c=%.o)

# Link command to compile + build binary:
link:	$(OBJS)
	gcc -I. main.o $(LINKER_FLAGS) -o $(TARGET) $(LIBS)

main.o: main.c
	gcc $(CFLAGS) -c $<

# Compilation command:
# Generic Way to create a .o file for each .c file (for many c files) $< is the "first dependency"
%.o: %.c
	gcc -c -o $@ $< $(CFLAGS)
	
#support for "make all"
all: link
	@echo "-- build of target: '$(TARGET)' finished --"

#support for "make clean"
clean:
	rm -f $(OBJS) $(TARGET) test
