Improve makefile

This commit is contained in:
Mark Nellemann 2022-11-11 16:05:46 +01:00
parent d726bc1982
commit 243f0062d9

View file

@ -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
CC = gcc
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)