PROJECT=ihe CC=gcc CFLAGS=-I./ SOURCES=buf.c core.c SOURCES+=$(wildcard cmd/*.c) OBJECTS=$(SOURCES:.c=.o) LIB_OBJECTS=libcmd/libcmd.o libterm/libterm.o all: clean $(OBJECTS) $(PROJECT) $(PROJECT): $(CC) -c $(PROJECT).c ld -r $(OBJECTS) $(PROJECT).o -o $(PROJECT)_.o $(CC) $(CFLAGS) $(PROJECT)_.o $(LIB_OBJECTS) -o $(PROJECT) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ clean: rm -f $(PROJECT) rm -f *.o leak: valgrind --leak-check=full --track-origins=yes --log-file=log.txt ./ihe