2021-05-02 15:19:33 -04:00
|
|
|
MultiThread = Yes
|
|
|
|
|
|
|
|
PROGNAME = torrent-verify
|
|
|
|
CC = cc
|
2021-05-04 12:34:35 -04:00
|
|
|
CFLAGS = -Wall -std=gnu11 -I./subm/heapless-bencode -Werror -O3
|
2021-05-02 15:19:33 -04:00
|
|
|
CPPFLAGS = -DPROGRAM_NAME='"$(PROGNAME)"' -DBUILD_INFO \
|
|
|
|
-DBUILD_HASH="\"`git rev-parse --abbrev-ref HEAD` -> `git rev-parse --short HEAD`\"" -DBUILD_DATE="\"`date -I`\""
|
|
|
|
|
|
|
|
ifeq ($(MultiThread), Yes)
|
|
|
|
CFLAGS += -lpthread
|
|
|
|
CPPFLAGS += -DMT
|
|
|
|
endif
|
|
|
|
|
|
|
|
SOURCE = $(wildcard subm/heapless-bencode/*.c) $(wildcard src/*.c)
|
|
|
|
#OBJ = $(addsuffix .o,$(basename $(SOURCE)))
|
|
|
|
OBJS = $(SOURCE:.c=.o)
|
|
|
|
|
|
|
|
all: $(PROGNAME)
|
|
|
|
|
|
|
|
$(PROGNAME): $(OBJS)
|
|
|
|
$(CC) -o $@ $+ $(CFLAGS) $(CPPFLAGS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -- $(OBJS) $(PROGNAME)
|