CFLAGS += LDFLAGS := -lm OBJECTS := obj/obcb.o obj/mongoose.o all: obcb.exe obcb-nbd.so live.exe live-1chunk.exe listen-fullmap.exe obcb-write.exe test: obcb ./obcb live-run: live ./live live-1chunk-run: live-1chunk ./live-1chunk bot-run: bot ./bot listen-fullmap-run: listen-fullmap ./listen-fullmap obcb-write.exe: ./src/obcb-write.c $(OBJECTS) $(CC) $(CFLAGS) $(OBJECTS) src/obcb-write.c $(LDFLAGS) -o $@ -lraylib -lm bot.exe: ./src/bot.c $(OBJECTS) $(CC) $(CFLAGS) $(OBJECTS) src/bot.c $(LDFLAGS) -o $@ -lraylib -lm listen-fullmap.exe: ./src/listen-fullmap.c $(OBJECTS) $(CC) $(CFLAGS) $(OBJECTS) src/listen-fullmap.c $(LDFLAGS) -o $@ -lraylib -lm live.exe: ./src/live.c $(OBJECTS) $(CC) $(CFLAGS) $(OBJECTS) src/live.c $(LDFLAGS) -o $@ -lraylib -lm live-1chunk.exe: ./src/live-1chunk.c $(OBJECTS) $(CC) $(CFLAGS) $(OBJECTS) src/live-1chunk.c $(LDFLAGS) -o $@ -lraylib -lm obcb.exe: lib $(OBJECTS) $(CC) $(CFLAGS) $(OBJECTS) src/main.c $(LDFLAGS) -o $@ nbd: obcb-nbd.so nbdkit --filter=blocksize-policy -fv ./obcb-nbd.so blocksize-error-policy=error obcb-nbd.so: src/obcb-nbd.c $(OBJECTS) $(CC) $(CFLAGS) $(OBJECTS) -fPIC -shared src/obcb-nbd.c -o obcb-nbd.so `pkg-config nbdkit --cflags --libs` lib: $(OBJECTS) clean: $(RM) $(OBJECTS) obcb.exe obcb-nbd.so live.exe live-1chunk.exe listen-fullmap.exe obcb-write.exe obj/%.o: src/%.c $(CC) $(CFLAGS) -c $^ -o $@ obj/mongoose.o: src/mongoose.c $(CC) $(CFLAGS) -c $^ -fPIC -o $@