@SET_MAKE@
CC = @CC@
CXX = @CXX@
AS = @CC@
LD = @CC@
CPP = @CC@
CFLAGS = @CFLAGS@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ -Wno-unused-function
ASFLAGS = @ASFLAGS@ -c @EXTRA_AS_FLAGS@
LDFLAGS = @LDFLAGS@ @OPENSSL_LIBS@
YASM = @YASM@
AR = @AR@
FIND = @FIND@
RM = /bin/rm -f

IN = secp256k1.o

all: secp256k1.a
default: secp256k1.a

secp256k1.o: secp256k1.c
	$(CC) -DHAVE_CONFIG_H $(CFLAGS) -c secp256k1.c -o secp256k1.o

.PHONY: subdirs $(SUBDIRS)

subdirs: $(SUBDIRS)

$(SUBDIRS):
	$(MAKE) -C $@ all

secp256k1.a: $(SUBDIRS) secp256k1.o
	$(AR) -rs $@ $(IN)

clean:
	$(FIND) . -name \*.a -exec $(RM) {} \;
	$(FIND) . -name \*.o -exec $(RM) {} \;

distclean: clean
	$(RM) Makefile
