PRODUCT=bot CC=gcc CFLAGS=-lb64 LFLAGS=-lssl -lcrypto -lpthread -lb64 SOURCES := $(shell find src/ -name '*.c') OBJS = $(sort $(subst src/,build/,$(subst .c,.o,$(SOURCES)))) install: $(PRODUCT) @echo "DONE!" $(PRODUCT): $(OBJS) @echo "LINKING $(PRODUCT)..." @$(CC) -o $@ $^ $(LFLAGS) clean: @echo "REMOVING OBJECT FILES..." @touch $(OBJS) @rm $(OBJS) build/%.o: src/%.c @mkdir -p build/ @echo "COMPILING $<..." @$(CC) -c $< -o $@ $(CFLAGS)