TARGET_EXEC := build/xbot SRCS := $(wildcard src/*.c) OBJS := $(patsubst src/%.c, build/%.o, $(SRCS)) LDFLAGS := -lstrophe -liniparser all: $(TARGET_EXEC) $(TARGET_EXEC): build/xbot.o mkdir -p build $(CC) $(LDFLAGS) -o $@ $< build/%.o: src/%.c mkdir -p build $(CC) -c $< -o $@ .PHONY: clean clean: rm -r build