CC = gcc LD = gcc CFLAGS += -std=c99 $(shell pkg-config --cflags libconfig) LDFLAGS += $(shell pkg-config --libs libconfig) OBJECTS = main.o config.o TARGET = ircstats all: $(TARGET) $(TARGET): $(OBJECTS) $(LD) $(LDFLAGS) -o $@ $^ %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< clean: rm -f $(OBJECTS) $(TARGET)