all: dnbd3-server CC?=gcc CFLAGS+=-pipe -DNDEBUG -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \ -O3 -W -Wall -Wextra -std=gnu11 -Wno-unused-parameter -Iinc/ #CC=clang #CFLAGS=-g -pipe -fsanitize=address -O1 -fno-omit-frame-pointer -W -Wall -Wextra -std=gnu99 -Wno-unused-parameter LIBS+=-ljansson -latomic -lpthread %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ dnbd3-server: inc/dnbd3/build.h \ src/server/altservers.o \ src/server/fileutil.o \ src/server/fuse.o \ src/server/globals.o \ src/server/helper.o \ src/server/image.o \ src/server/ini.o \ src/server/integrity.o \ src/server/locks.o \ src/server/net.o \ src/server/picohttpparser/picohttpparser.o \ src/server/reference.o \ src/server/rpc.o \ src/server/server.o \ src/server/threadpool.o \ src/server/uplink.o \ src/server/urldecode.o \ src/shared/crc32.o \ src/shared/fdsignal.o \ src/shared/log.o \ src/shared/serialize.o \ src/shared/sockhelper.o \ src/shared/timing.o $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) ${LIBS} inc/dnbd3/build.h: @sed "s/@DNBD3_BUILD@/Makefile/;s/@DNBD3_BUILD_DATE@/$$(date +%Y-%m-%d)/" inc/dnbd3/build.h.in > inc/dnbd3/build.h .PHONY: clean inc/dnbd3/build.h clean: rm -f -- *.[ao] dnbd3-server inc/dnbd3/build.h src/*/*.o src/*/*/*.o