Update Makefile
Use pkg-config instead of absolute paths, optimise binary when installing, and other miscellaneous changes.
This commit is contained in:
parent
84b6c1eafa
commit
7637e6f609
11
Makefile
11
Makefile
@ -1,13 +1,15 @@
|
|||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
VERSION = 0.1
|
VERSION = 0.1
|
||||||
|
|
||||||
|
# CC = cc
|
||||||
SRC = minrss.c util.c net.c xml.c
|
SRC = minrss.c util.c net.c xml.c
|
||||||
OBJ = $(SRC:.c=.o)
|
OBJ = $(SRC:.c=.o)
|
||||||
CC = cc
|
PKG_CONFIG = pkg-config
|
||||||
INCS =
|
CURL_CONFIG = curl-config
|
||||||
LIBS = -lcurl -I/usr/include/libxml2 -lxml2
|
INCS = `$(PKG_CONFIG) --cflags libxml-2.0` `$(CURL_CONFIG) --cflags`
|
||||||
|
LIBS = `$(PKG_CONFIG) --libs libxml-2.0` `$(CURL_CONFIG) --libs`
|
||||||
WARN = -Wall -Wpedantic -Wextra
|
WARN = -Wall -Wpedantic -Wextra
|
||||||
CFLAGS = $(LIBS) $(INCS) $(WARN) -DVERSION=\"$(VERSION)\"
|
CFLAGS = $(INCS) $(LIBS) $(WARN) -DVERSION=\"$(VERSION)\"
|
||||||
|
|
||||||
all: config.h minrss
|
all: config.h minrss
|
||||||
|
|
||||||
@ -26,6 +28,7 @@ minrss: $(OBJ)
|
|||||||
clean:
|
clean:
|
||||||
rm -f minrss $(OBJ)
|
rm -f minrss $(OBJ)
|
||||||
|
|
||||||
|
install: CFLAGS += -O3
|
||||||
install: all
|
install: all
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
cp -f minrss $(DESTDIR)$(PREFIX)/bin
|
cp -f minrss $(DESTDIR)$(PREFIX)/bin
|
||||||
|
Loading…
Reference in New Issue
Block a user