summaryrefslogtreecommitdiffstats
path: root/src/Makefile
blob: 339522dc03c776634f987e02590584ec6a9d8196 (plain)
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
INSTALL = install

VERSION = $(shell git describe --dirty --always)

CFLAGS  += -Wall -DVERSION="\"$(VERSION)\""
LDFLAGS +=

TARGETS := exchange
MAINS   := $(addsuffix .o, $(TARGETS))
OBJ     := $(MAINS)

.PHONY: all
all: $(TARGETS)

.PHONY: clean
clean:
	rm -f $(OBJ) $(TARGETS)

.PHONY: install
install: $(TARGETS)
	$(INSTALL) -Dt "$(DESTDIR)$(prefix)/bin" $(TARGETS)

.PHONY: uninstall
uninstall:
	cd $(DESTDIR)$(prefix)/bin && rm -f $(TARGETS)


$(TARGETS): % : %.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^