minrss/Makefile

45 lines
984 B
Makefile
Raw Normal View History

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
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)
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
$(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
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)
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