Install in makefile
This commit is contained in:
parent
2d3efaf5e8
commit
15d997f592
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,2 @@
|
||||
main
|
||||
bff
|
||||
*.o
|
||||
|
19
Makefile
19
Makefile
@ -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.*
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user