Last active
August 29, 2015 14:19
-
-
Save jpleau/327b2653633e97d955fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SONAME_MAJOR=5 | |
SONAME_MINOR=6 | |
LIBNAME=libmongoose | |
SHARED_LIB=$(LIBNAME).so.$(SONAME_MAJOR).$(SONAME_MINOR) | |
STATIC_LIB=$(LIBNAME).a | |
ifndef PREFIX | |
PREFIX=/usr/local | |
endif | |
ifndef LIBDIR | |
LIBDIR=$(PREFIX)/lib | |
endif | |
ifndef DOCDIR | |
DOCDIR=$(PREFIX)/share/$(LIBNAME)/doc | |
endif | |
CPPFLAGS+=-DMONGOOSE_ENABLE_THREADS -DNS_ENABLE_SSL -DNS_ENABLE_IPV6 | |
CFLAGS+=-fPIC -c -Wall | |
LDFLAGS+=-shared -Wl,-soname,$(LIBNAME).so.$(SONAME_MAJOR) -lssl -pthread | |
SRCS=mongoose.c | |
OBJS=mongoose.o | |
INCLUDE=. | |
all: $(SHARED_LIB) $(STATIC_LIB) | |
$(SHARED_LIB): $(OBJS) | |
$(CC) $(OBJS) $(LDFLAGS) -o $(SHARED_LIB) | |
$(STATIC_LIB): | |
$(AR) rcs $(STATIC_LIB) $(OBJS) | |
$(OBJS): $(SRCS) | |
$(CC) $(CPPFLAGS) $(CFLAGS) -I$(INCLUDE) $(SRCS) -o $(OBJS) | |
install: $(SHARED_LIB) | |
install -Dm644 $(STATIC_LIB) $(DESTDIR)$(LIBDIR)/$(STATIC_LIB) | |
install -Dm644 $(SHARED_LIB) $(DESTDIR)$(LIBDIR)/$(SHARED_LIB) | |
install -Dm644 mongoose.h $(DESTDIR)$(PREFIX)/include/mongoose.h | |
ln -s $(SHARED_LIB) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so.$(SONAME_MAJOR) | |
ln -s $(SHARED_LIB) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so | |
install -dm755 $(DESTDIR)$(DOCDIR) | |
cp -a examples $(DESTDIR)$(DOCDIR) | |
cp -a docs/* $(DESTDIR)$(DOCDIR)/ | |
test: | |
$(MAKE) -C test/ | |
clean: | |
rm -f $(OBJS) $(SHARED_LIB) $(STATIC_LIB) | |
$(MAKE) -C test/ clean | |
.PHONY: clean test all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix="/usr" | |
exec_prefix="/usr" | |
libdir="/usr/lib/#DEB_HOST_MULTIARCH#" | |
includedir="/usr/include" | |
Name: mongoose | |
Description: embedded library, to start a web server in few lines of code | |
Version: 5.6 | |
Requires: libssl | |
Libs: -L${libdir} -lmongoose | |
Cflags: -I${includedir} -pthread |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment