about summary refs log tree commit diff
path: root/Makefile
blob: 4957f8200b64febbd14145a55d937de175029c5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
BIN = ministat 
SRCS= ministat.c
OBJS= ministat.o
MAN = ministat.1

PKGS = 

CFLAGS  += -g -Wall -Werror
CPPFLAGS+= -I. -D_GNU_SOURCE
LDFLAGS += -lm

PREFIX ?= /usr

# No user serviceable parts below this line.
#PPFLAGS+= $(shell pkg-config --silence-errors --cflags $(PKGS))
#LDFLAGS += $(shell pkg-config --silence-errors --libs $(PKGS))

all: $(BIN)

$(BIN): $(OBJS)
	$(CC) $(OBJS) ${LDFLAGS} -o ${BIN}

$(OBJS): %.o: %.c
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $<

install:
	install -d $(PREFIX)/bin
	install -m 0755 $(BIN) $(PREFIX)/bin/$(BIN)
	install -m 0755 $(MAN) $(PREFIX)/share/man/man1/$(MAN)

clean:
	-rm -rf $(BIN) *.o *.core

.PHONY: install clean

-include $(DEPS)