torrent-verifier/Makefile

38 lines
876 B
Makefile
Raw Permalink Normal View History

2021-05-02 15:19:33 -04:00
MultiThread = Yes
2022-07-14 09:33:32 -04:00
HttpTorrent = Yes
InstallPrefix = /usr/local/bin
2021-05-02 15:19:33 -04:00
PROGNAME := torrent-verify
CFLAGS := -Wall -std=gnu11 -I./subm/heapless-bencode -Werror -O2 -flto
CPPFLAGS := -DPROGRAM_NAME='"$(PROGNAME)"' -DBUILD_INFO \
2021-05-02 15:19:33 -04:00
-DBUILD_HASH="\"`git rev-parse --abbrev-ref HEAD` -> `git rev-parse --short HEAD`\"" -DBUILD_DATE="\"`date -I`\""
ifeq ($(MultiThread), Yes)
2022-07-14 09:33:32 -04:00
LDLIBS += -lpthread
2021-05-02 15:19:33 -04:00
CPPFLAGS += -DMT
endif
2022-07-14 09:33:32 -04:00
ifeq ($(HttpTorrent), Yes)
LDLIBS += -lcurl
CPPFLAGS += -DHTTP_TORRENT=1
endif
2021-05-02 15:19:33 -04:00
SOURCE = $(wildcard subm/heapless-bencode/*.c) $(wildcard src/*.c)
#OBJ = $(addsuffix .o,$(basename $(SOURCE)))
OBJS = $(SOURCE:.c=.o)
all: $(PROGNAME)
install: $(PROGNAME)
install -s -- $< $(InstallPrefix)/$(PROGNAME)
uninstall:
2021-05-23 12:23:39 -04:00
rm -f -- $(InstallPrefix)/$(PROGNAME)
2021-05-02 15:19:33 -04:00
$(PROGNAME): $(OBJS)
2022-07-14 09:33:32 -04:00
$(CC) -o $@ $+ $(CFLAGS) $(CPPFLAGS) $(LDLIBS)
2021-05-02 15:19:33 -04:00
clean:
-rm -- $(OBJS) $(PROGNAME)