2021-03-24 04:51:10 +03:00
|
|
|
OBJS=az-hibernate-agent.o
|
2021-06-29 21:24:33 +03:00
|
|
|
CFLAGS+=-Os -Wall -Wextra -std=gnu11 -fstack-protector-all -D_FORTIFY_SOURCE=1
|
|
|
|
LDFLAGS+=-Wl,-z,relro,-z,now
|
2021-03-24 04:51:10 +03:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $< $(CFLAGS) -o $@
|
|
|
|
|
|
|
|
az-hibernate-agent: $(OBJS)
|
|
|
|
$(CC) $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
all: az-hibernate-agent
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS)
|
|
|
|
rm -f az-hibernate-agent
|
|
|
|
|
2021-06-25 19:31:04 +03:00
|
|
|
.PHONY: install
|
2021-03-24 04:51:10 +03:00
|
|
|
install: all
|
2021-03-24 06:58:28 +03:00
|
|
|
install -m 0755 -d $(DESTDIR)/usr/sbin
|
2021-03-24 07:07:07 +03:00
|
|
|
install -m 0755 -d $(DESTDIR)/lib/systemd/system/
|
2021-03-24 06:58:28 +03:00
|
|
|
install -m 0755 az-hibernate-agent $(DESTDIR)/usr/sbin
|
2021-03-24 07:07:07 +03:00
|
|
|
install -m 0644 az-hibernate-agent.service $(DESTDIR)/lib/systemd/system
|
2021-06-25 19:31:04 +03:00
|
|
|
|
|
|
|
.PHONY: indent
|
|
|
|
indent:
|
|
|
|
clang-format az-hibernate-agent.c > indented.c
|
|
|
|
mv indented.c az-hibernate-agent.c
|