summaryrefslogblamecommitdiffstats
path: root/prog/6/makefile
blob: 8bd7dbeacaf6abfa6f8f215e6b31c1ee2eef8627 (plain) (tree)
1
2
3
4
5
6
7
8


                                                
                            


              
                   




























                                                                                                                                             
DESTDIR=/
CC=cc
MYCFLAGS=-O0 -Wall -Wextra -Wformat -pedantic -g
MYLDFLAGS=-lresolv -lconfuse

default: 6d 6c

6d: daemon.c conf.c
	$(CC) $(MYCFLAGS) $(CFLAGS) $< -o$@ $(MYLDFLAGS) $(LDFLAGS)

6c: client.c
	$(CC) $(MYCFLAGS) $(CFLAGS) $< -o$@ $(MYLDFLAGS) $(LDFLAGS)

install: 6d 6c
	mkdir -p $(DESTDIR)/usr/bin/
	cp 6d $(DESTDIR)/usr/bin/
	cp 6c $(DESTDIR)/usr/bin/

uninstall:
	rm -fr $(DESTDIR)/usr/bin/6d
	rm -fr $(DESTDIR)/usr/bin/6c

distclean: clean

clean:
	rm -fr 6d 6c

valgrind:
	valgrind --error-exitcode=59 --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt $(CMD)

# tests if code compiles under gcc, clang and tcc
cc:
	make -e CC=tcc
	make -e CC=gcc
	make -e CC=clang

.PHONY: default, install, distclean, clean, valgrind, cc, uninstall