Install in makefile

This commit is contained in:
Debucquoy Anthony 2023-12-01 14:07:33 +01:00
parent 2d3efaf5e8
commit 15d997f592
Signed by: tonitch
GPG Key ID: A78D6421F083D42E
3 changed files with 15 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,3 +1,2 @@
main
bff
*.o

View File

@ -1,15 +1,26 @@
.PHONY: clean, mrproper
.PHONY: clean, mrproper, uninstall, install
CC = gcc
CFLAGS = -g -Wall
LDFLAGS =
all: bff
PREFIX = /usr/local
%.o: %.c
all: bff
bff.o: bff.c
$(CC) $(CFLAGS) -c -o $@ $<
bff: main.o
bff: bff.o
$(CC) $(CFLAGS) -o $@ $+
install: bff
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f bff $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/bff
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/bff
clean:
rm -f *.o core.*

View File