Skip to content

Commit

Permalink
Optimisation du Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bplessis authored and ptitoliv committed Sep 4, 2018
1 parent 0a48095 commit 8ab356c
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
CFLAGS=-Wall -Wextra -O2 -fPIC $(shell pkg-config --cflags libnl-route-3.0)
LDFLAGS=-rdynamic $(shell pkg-config --libs libnl-route-3.0)
PREFIX=/usr/
DESTDIR=
CFLAGS += -Wall -Wextra -O2 -fPIC $(shell pkg-config --cflags libnl-route-3.0)
LDFLAGS += $(shell pkg-config --libs libnl-route-3.0)
PREFIX ?= /lib/security
DESTDIR ?=

all: pam_ela.so
MODULE=pam_ela.so

pam_ela.so: pam_ela.o
$(CC) -shared -o $@ $^ $(LDFLAGS)
all: $(MODULE)

%.so: %.o
ld -x --shared -o $@ $< $(LDFLAGS)

clean:
rm -f pam_ela.so pam_ela.o
rm -f $(MODULE) $(MODULE:.so=.o)

install: pam_ela.so
mkdir -p -- "$(DESTDIR)$(PREFIX)"/lib64/security/
install -- "$<" "$(DESTDIR)$(PREFIX)"/lib64/security/
install: $(MODULE)
mkdir -p -- "$(DESTDIR)$(PREFIX)"
install -- "$<" "$(DESTDIR)$(PREFIX)"

uninstall:
rm -f -- "$(DESTDIR)$(PREFIX)"/lib64/security/pam_ela.so
rm -f -- "$(DESTDIR)$(PREFIX)/$(MODULE)"

.PHONY: all test clean install uninstall

0 comments on commit 8ab356c

Please sign in to comment.