# Makefile for vshttpsd
# $@ = target file
# $< = first dependency
# $^ = all dependencies

find_exe = $(abspath $(strip $(firstword $(foreach dir,$(strip $(subst :, ,${PATH})),$(wildcard $(dir)/$(1))))))

OSTYPE := $(shell uname)
LIBS = -lssl -lcrypto

ifeq ($(OSTYPE),SunOS)
        LIBS += -lsocket -lnsl
endif

ifeq ($(call find_exe,$(CC)),)
        $(info ****************************************)
        $(info We need a C compiler)
        $(info ****************************************)
        $(error )
endif


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

clean:
	rm -f vshttpsd
