summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 8c5101381e41cbecd2efa6605243c0e00de8b817 (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
30
CC	= gcc
CFLAGS	= -O3 -g -D_FORTIFY_SOURCE=2 -W -Wall
LDFLAGS	=
AR	= ar
RANLIB	= ranlib

LIBOBJ	= pbn_add.o pbn_cmp.o pbn_dump.o pbn_init.o \
	  pbn_mul.o pbn_muls.o pbn_mulus_add.o \
	  pbn_shift.o pbn_and.o pbn_or.o pbn_xor.o pbn_bit.o pbn_ctz.o \
	  pbn_abs.o pbn_div.o pbn_divs.o

LIB     = pbn.a

TESTS	= test

.c.o:
	$(CC) $(CFLAGS) -c -o $@ $<

all: $(TESTS) $(LIB)

$(LIB): $(LIBOBJ)
	rm -f $@
	$(AR) cq $@ $^
	$(RANLIB) $@

test: test.o $(LIB)
	$(CC) $(LDFLAGS) -o $@ $^

clean:
	rm -f $(TESTS) $(LIB) *.o