Install in makefile
This commit is contained in:
parent
2d3efaf5e8
commit
15d997f592
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,2 @@
|
|||||||
main
|
|
||||||
bff
|
bff
|
||||||
*.o
|
*.o
|
||||||
|
17
Makefile
17
Makefile
@ -1,15 +1,26 @@
|
|||||||
.PHONY: clean, mrproper
|
.PHONY: clean, mrproper, uninstall, install
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -g -Wall
|
CFLAGS = -g -Wall
|
||||||
|
LDFLAGS =
|
||||||
|
|
||||||
|
PREFIX = /usr/local
|
||||||
|
|
||||||
all: bff
|
all: bff
|
||||||
|
|
||||||
%.o: %.c
|
bff.o: bff.c
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
bff: main.o
|
bff: bff.o
|
||||||
$(CC) $(CFLAGS) -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:
|
clean:
|
||||||
rm -f *.o core.*
|
rm -f *.o core.*
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user