Improve makefile
This commit is contained in:
parent
d726bc1982
commit
243f0062d9
19
Makefile
19
Makefile
|
@ -1,16 +1,17 @@
|
|||
#
|
||||
# gcc -I/usr/include -L/usr/lib -lperfstat -o test test.c
|
||||
# Use GNU-Make (gmake) for building
|
||||
#
|
||||
bin = aix-disk-perfstat
|
||||
src = $(wildcard *.c)
|
||||
obj = $(src:.c=.o)
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=
|
||||
BIN=aix-disk-perfstat
|
||||
LDFLAGS = -lperfstat
|
||||
|
||||
default: main
|
||||
|
||||
main: main.o
|
||||
$(CC) -lperfstat -o $(BIN) main.c
|
||||
$(bin): $(obj)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f main.o
|
||||
-rm -f $(BIN)
|
||||
rm -f $(obj) $(bin)
|
||||
|
||||
|
|
Loading…
Reference in a new issue