# Makefile for scScript
#
# NoDebug --> CFLAGS =  -Wall -I/usr/include/freetype2
# Debug   --> CFLAGS =  -g3 -Wall -DDEBUG -I/usr/include/freetype2
#
# For Valgrind, add -g to NoDebug build
# valgrind --leak-check=full --log-file=valgrind_out.txt ./scScript


all: scScript

CC ?= gcc
#CFLAGS = -Wall -I/usr/include/freetype2
CFLAGS =  -g3 -Wall -DDEBUG -I/usr/include/freetype2
Objects = sc_Main.o sc_Editor.o sc_Script.o

scScript: $(Objects)
	$(CC) $(Objects) -o scScript -lX11 -lXft -lffi -lm

sc_Main.o: sc_Main.c sc_Main.h sc_Editor.h sc_Error.h sc_Public.h
	$(CC) $(CFLAGS)  -c sc_Main.c

sc_Editor.o: sc_Editor.c sc_Script.h sc_Main.h sc_Editor.h sc_Error.h sc_Public.h
	$(CC) $(CFLAGS) -c sc_Editor.c

sc_Script.o: sc_Script.c sc_Script.h sc_Main.h sc_Editor.h sc_Error.h sc_Public.h
	$(CC) $(CFLAGS) -c sc_Script.c

.PHONY : clean
clean:
	-rm scScript $(Objects)


