obcb/Makefile

56 lines
1.4 KiB
Makefile
Raw Normal View History

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
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
2024-10-03 15:49:08 +03:00
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
2024-10-03 15:49:08 +03:00
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
2024-10-03 15:49:08 +03:00
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
2024-09-05 20:56:32 +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:
$(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 $@