minrss/Makefile

43 lines
964 B
Makefile
Raw Normal View History

2021-08-24 15:27:54 -04:00
PREFIX = ~/.local
2023-01-15 11:15:08 -05:00
VERSION = 0.3
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)
2021-08-02 11:41:15 -04:00
WARN = -Wall -Wpedantic -Wextra
2023-01-15 12:33:27 -05:00
CFLAGS = -std=c99 $(INCS) $(LIBS) $(WARN) -DVERSION=\"$(VERSION)\" $(JSONFLAG)
2021-08-02 11:41:15 -04:00
all: config.h minrss
debug: CFLAGS += -g3
debug: config.h minrss
config.h:
cp config.def.h config.h
.c.o:
$(CC) $(CFLAGS) -c $<
minrss: $(OBJ)
$(CC) $(CFLAGS) -o $@ $(OBJ)
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