2021-08-24 15:27:54 -04:00
|
|
|
PREFIX = ~/.local
|
2023-06-16 15:24:51 -04:00
|
|
|
VERSION = 0.4.0
|
2021-08-02 13:55:46 -04:00
|
|
|
|
2021-08-05 20:18:48 -04:00
|
|
|
PKG_CONFIG = pkg-config
|
2022-10-29 22:29:34 -04:00
|
|
|
|
|
|
|
# Comment out if JSON output support isn't needed
|
|
|
|
JSONLIBS = `$(PKG_CONFIG) --libs json-c`
|
|
|
|
JSONINCS = `$(PKG_CONFIG) --cflags json-c`
|
|
|
|
JSONFLAG = -DJSON
|
|
|
|
|
|
|
|
SRC = minrss.c util.c net.c handlers.c
|
|
|
|
OBJ = $(SRC:.c=.o)
|
2023-01-15 19:24:30 -05:00
|
|
|
INCS = `$(PKG_CONFIG) --cflags libxml-2.0` `$(PKG_CONFIG) --cflags libcurl` $(JSONINC)
|
|
|
|
LIBS = `$(PKG_CONFIG) --libs libxml-2.0` `$(PKG_CONFIG) --libs libcurl` $(JSONLIBS)
|
2023-01-15 19:49:04 -05:00
|
|
|
WFLAGS = -Wall -Wpedantic -Wextra
|
|
|
|
CFLAGS = -std=c99 $(INCS) $(WFLAGS) -DVERSION=\"$(VERSION)\" $(JSONFLAG)
|
2021-08-02 11:41:15 -04:00
|
|
|
|
|
|
|
all: config.h minrss
|
|
|
|
|
|
|
|
debug: CFLAGS += -g3
|
|
|
|
debug: config.h minrss
|
|
|
|
|
2023-03-22 20:01:07 -04:00
|
|
|
$(OBJ): config.h
|
2021-08-02 11:41:15 -04:00
|
|
|
|
|
|
|
.c.o:
|
2023-01-15 19:49:04 -05:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2021-08-02 11:41:15 -04:00
|
|
|
|
2023-03-22 20:01:07 -04:00
|
|
|
config.h:
|
|
|
|
cp config.def.h config.h
|
|
|
|
|
2021-08-02 11:41:15 -04:00
|
|
|
minrss: $(OBJ)
|
2023-01-15 19:49:04 -05:00
|
|
|
$(CC) -o $@ $(OBJ) $(LIBS)
|
2021-08-02 11:41:15 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f minrss $(OBJ)
|
|
|
|
|
2021-08-05 20:18:48 -04:00
|
|
|
install: CFLAGS += -O3
|
2021-08-02 11:41:15 -04:00
|
|
|
install: all
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
|
|
cp -f minrss $(DESTDIR)$(PREFIX)/bin
|
|
|
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/minrss
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/minrss
|