aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: ad3bde079e7e913a3a19af6155339b9caa8048f5 (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
CPP=g++
CC=gcc
CFLAGS=-fPIC -g3 -Wall -Wwrite-strings -fno-exceptions -fno-unwind-tables -fpermissive
CPPFLAGS=-fPIC -g3 -Wall -Wwrite-strings -fpermissive -fno-rtti -fno-exceptions -fno-unwind-tables

make: 
	$(CPP) $(CPPFLAGS) -c buf.c
	$(CPP) $(CPPFLAGS) -c buf_misc.c
	#$(CPP) $(CFLAGS) -c buf_sys.c
	#$(CC) $(CFLAGS) -fPIC -lc -ldl buf_sys.o buf_misc.o buf.o -shared -o libbuf.so
	$(CC) $(CFLAGS) -fPIC -lc -ldl buf.o buf_misc.o -shared -o libbuf.so

t: buf.c buf_misc.c buf_sys.c
	$(CPP) $(CPPFLAGS) test.c -c
	$(CPP) $(CPPFLAGS) test_line.c -c
	$(CC) $(CFLAGS) buf.o  test.o -o test
	#$(CC) $(CFLAGS) buf.o buf_misc.o buf_sys.o test_circ.c -o test_circ
	#$(CC) $(CFLAGS) buf.o buf_misc.o buf_sys.o test_circ.c -o test_sys
	$(CC) $(CFLAGS) buf.o buf_misc.o test_line.o -o test_line

leak:
	valgrind --leak-check=full --track-origins=yes --log-file=log.txt ./test

clean:
	rm -rf *.so *.o test test_circ test_sys