1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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