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 CC = gcc
CFLAGS= LDFLAGS = -lperfstat
BIN=aix-disk-perfstat
default: main $(bin): $(obj)
$(CC) -o $@ $^ $(LDFLAGS)
main: main.o
$(CC) -lperfstat -o $(BIN) main.c
.PHONY: clean
clean: clean:
-rm -f main.o rm -f $(obj) $(bin)
-rm -f $(BIN)