2024-09-05 20:56:32 +03:00
|
|
|
CFLAGS +=
|
|
|
|
LDFLAGS := -lm
|
2024-09-06 23:01:35 +03:00
|
|
|
OBJECTS := obj/obcb.o obj/mongoose.o
|
2024-09-05 20:56:32 +03:00
|
|
|
|
2024-10-15 09:40:37 +03:00
|
|
|
all: obcb.exe obcb-nbd.so live.exe live-1chunk.exe listen-fullmap.exe obcb-write.exe
|
2024-09-06 16:06:19 +03:00
|
|
|
|
|
|
|
test: obcb
|
|
|
|
./obcb
|
|
|
|
|
|
|
|
live-run: live
|
|
|
|
./live
|
|
|
|
|
2024-09-06 20:19:37 +03:00
|
|
|
live-1chunk-run: live-1chunk
|
|
|
|
./live-1chunk
|
|
|
|
|
|
|
|
bot-run: bot
|
|
|
|
./bot
|
|
|
|
|
2024-10-03 15:49:08 +03:00
|
|
|
listen-fullmap-run: listen-fullmap
|
|
|
|
./listen-fullmap
|
|
|
|
|
2024-10-15 09:40:37 +03:00
|
|
|
obcb-write.exe: ./src/obcb-write.c $(OBJECTS)
|
|
|
|
$(CC) $(CFLAGS) $(OBJECTS) src/obcb-write.c $(LDFLAGS) -o $@ -lraylib -lm
|
2024-10-03 15:49:08 +03:00
|
|
|
|
2024-10-15 09:40:37 +03:00
|
|
|
bot.exe: ./src/bot.c $(OBJECTS)
|
|
|
|
$(CC) $(CFLAGS) $(OBJECTS) src/bot.c $(LDFLAGS) -o $@ -lraylib -lm
|
2024-09-06 20:19:37 +03:00
|
|
|
|
2024-10-15 09:40:37 +03:00
|
|
|
listen-fullmap.exe: ./src/listen-fullmap.c $(OBJECTS)
|
|
|
|
$(CC) $(CFLAGS) $(OBJECTS) src/listen-fullmap.c $(LDFLAGS) -o $@ -lraylib -lm
|
2024-10-03 15:49:08 +03:00
|
|
|
|
2024-10-15 09:40:37 +03:00
|
|
|
live.exe: ./src/live.c $(OBJECTS)
|
|
|
|
$(CC) $(CFLAGS) $(OBJECTS) src/live.c $(LDFLAGS) -o $@ -lraylib -lm
|
2024-09-06 16:06:19 +03:00
|
|
|
|
2024-10-15 09:40:37 +03:00
|
|
|
live-1chunk.exe: ./src/live-1chunk.c $(OBJECTS)
|
|
|
|
$(CC) $(CFLAGS) $(OBJECTS) src/live-1chunk.c $(LDFLAGS) -o $@ -lraylib -lm
|
2024-09-06 20:19:37 +03:00
|
|
|
|
2024-10-15 09:40:37 +03:00
|
|
|
obcb.exe: lib $(OBJECTS)
|
|
|
|
$(CC) $(CFLAGS) $(OBJECTS) src/main.c $(LDFLAGS) -o $@
|
2024-09-06 16:06:19 +03:00
|
|
|
|
|
|
|
nbd: obcb-nbd.so
|
|
|
|
nbdkit --filter=blocksize-policy -fv ./obcb-nbd.so blocksize-error-policy=error
|
2024-09-05 20:56:32 +03:00
|
|
|
|
2024-09-06 20:19:37 +03:00
|
|
|
obcb-nbd.so: src/obcb-nbd.c $(OBJECTS)
|
2024-09-06 23:01:35 +03:00
|
|
|
$(CC) $(CFLAGS) $(OBJECTS) -fPIC -shared src/obcb-nbd.c -o obcb-nbd.so `pkg-config nbdkit --cflags --libs`
|
2024-09-05 20:56:32 +03:00
|
|
|
|
|
|
|
lib: $(OBJECTS)
|
|
|
|
|
|
|
|
clean:
|
2024-10-15 09:40:37 +03:00
|
|
|
$(RM) $(OBJECTS) obcb.exe obcb-nbd.so live.exe live-1chunk.exe listen-fullmap.exe obcb-write.exe
|
2024-09-05 20:56:32 +03:00
|
|
|
|
|
|
|
obj/%.o: src/%.c
|
|
|
|
$(CC) $(CFLAGS) -c $^ -o $@
|
2024-09-06 23:01:35 +03:00
|
|
|
|
|
|
|
obj/mongoose.o: src/mongoose.c
|
|
|
|
$(CC) $(CFLAGS) -c $^ -fPIC -o $@
|