From: ken Date: Fri, 14 Oct 2016 03:07:45 +0000 (-0700) Subject: make dir unhidden X-Git-Url: https://git.kengrimes.com/?p=henge%2Fwebcc.git;a=commitdiff_plain;h=dbd7586f209f9e98015e3535ceb15bdb3417896c make dir unhidden --- diff --git a/Makefile b/Makefile index abcd469..8ce0adf 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ SRC_DIR := $(ROOT_DIR)/src # directory where files with 'main' functions live (can be in SRC_DIR) DRIVER_DIR := $(SRC_DIR)/bin # make configuration directory -CONF_DIR := $(ROOT_DIR)/.make +CONF_DIR := $(ROOT_DIR)/make # Source languages handled by this build system. These languages are capable of # being compiled to an intermediary format for binary output by one of the # provided compilersfor each language diff --git a/make/SDL2.mk b/make/SDL2.mk new file mode 100644 index 0000000..2b85c1d --- /dev/null +++ b/make/SDL2.mk @@ -0,0 +1,26 @@ +################################################################################ +# Desc: SDL2 Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# SDL2 natively supports transpiling (well, almost) +################################################################################ +# Download location +HGADDR := https://hg.libsdl.org/SDL +# No autogen for SDL +undefine AUTOGEN +# Ensure we have our other libraries, and their associated +# accutrements (like jpeg/tiff, etc from SDL2_image) +LIBDEPS := SDL2_image SDL2_ttf SDL2_net +# Modifications to the build process when using specific compilers +define emccMOD = +$(eval CONFIGURE += --enable-joystick=no) +$(eval CONFIGURE += --enable-pthreads=no) +$(eval CONFIGURE += --enable-threads=no) +MKCMD := $(subst make , emmake make ,$(MKCMD)) +CONFIGURE := $(subst ./configure , emconfigure ./configure ,$(CONFIGURE)) +endef +define em++MOD = +$(call EMCCMOD) +endef +$(eval $(call $(c_C)MOD)) diff --git a/make/SDL2_image.mk b/make/SDL2_image.mk new file mode 100644 index 0000000..ed96b59 --- /dev/null +++ b/make/SDL2_image.mk @@ -0,0 +1,11 @@ +################################################################################ +# Desc: SDL2_image Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# SDL2_image natively supports transpiling +################################################################################ +# Download location +HGADDR := https://hg.libsdl.org/SDL_image +# SDL2_image depends on zlib, libpng, libtiff libpjeg, and libwebp +LIBDEPS := webp png tiff z diff --git a/make/SDL2_net.mk b/make/SDL2_net.mk new file mode 100644 index 0000000..04f4d4c --- /dev/null +++ b/make/SDL2_net.mk @@ -0,0 +1,10 @@ +################################################################################ +# Desc: SDL2_net Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# SDL2_net natively supports transpiling +################################################################################ +# Download location +HGADDR := https://hg.libsdl.org/SDL_net + diff --git a/make/SDL2_ttf.mk b/make/SDL2_ttf.mk new file mode 100644 index 0000000..298db62 --- /dev/null +++ b/make/SDL2_ttf.mk @@ -0,0 +1,9 @@ +################################################################################ +# Desc: SDL2_ttf Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# SDL2_ttf natively supports transpiling +################################################################################ +# Download location +HGADDR := https://hg.libsdl.org/SDL_ttf diff --git a/make/jpeg.mk b/make/jpeg.mk new file mode 100644 index 0000000..307619a --- /dev/null +++ b/make/jpeg.mk @@ -0,0 +1,36 @@ +################################################################################ +# Desc: openjpeg Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# openjpeg natively supports transpiling +################################################################################ +# Download location +GITADDR := https://github.com/uclouvain/openjpeg +# OpenJPEG depends on png, tiff, lcms2, and z +LIBDEPS := png tiff lcms2 z +# Cmake autogen +CMAKEOPT := -DPNG_LIBRARY:FILEPATH="$(abspath $(LIB_DIR)/libpng.so)" +CMAKEOPT += -DPNG_INCLUDE_DIR:PATH="$(abspath $(ROOT_DIR)/include)" +CMAKEOPT += -DPNG_PNG_INCLUDE_DIR:PATH="$(abspath $(ROOT_DIR)/include)" +CMAKEOPT += -DZLIB_LIBRARY:FILEPATH="$(abspath $(LIB_DIR)/libz.so)" +CMAKEOPT += -DZLIB_INCLUDE_DIR:PATH="$(abspath $(ROOT_DIR)/include)" +CMAKEOPT += -DTIFF_LIBRARY:FILEPATH="$(abspath $(LIB_DIR)/libtiff.so)" +CMAKEOPT += -DTIFF_INCLUDE_DIR:PATH="$(abspath $(ROOT_DIR)/include)" +CMAKEOPT += -DBUILD_SHARED_LIBS:bool=off +AUTOGEN := mkdir -p build && cd build +AUTOGEN += && cmake $(CMAKEOPT) .. +undefine CONFIGURE +# Make is now in the build dir +MKINSTALL := cd build && make DESTDIR=$(abspath $(LIB_DIR)/.trash) install + +# Emscripten mods +define emccMOD = +$(eval AUTOGEN := $(subst cmake , emcmake cmake ,$(AUTOGEN))) +endef +define em++MOD = +$(call emccMOD) +endef +ifdef $($(c_C)MOD) +$(eval $(call $($(c_C)MOD))) +endif diff --git a/make/lcms2.mk b/make/lcms2.mk new file mode 100644 index 0000000..80d09ce --- /dev/null +++ b/make/lcms2.mk @@ -0,0 +1,11 @@ +################################################################################ +# Desc: liblcms2 Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# png natively supports transpiling +################################################################################ +# Download location +WEBADDR := https://sourceforge.net/projects/lcms/files/latest/download +WEBTARG := liblcms2-latest.tar.gz +WEBINIT := rm -Rf lcms2 && tar -xvf $(WEBTARG) && cp -r lcms2-*/ lcms2 diff --git a/make/png.mk b/make/png.mk new file mode 100644 index 0000000..320f4be --- /dev/null +++ b/make/png.mk @@ -0,0 +1,21 @@ +################################################################################ +# Desc: libpng Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# png natively supports transpiling +################################################################################ +# Download location +WEBADDR := https://sourceforge.net/projects/libpng/files/latest/download +WEBTARG := libpng-latest.tar.gz +WEBINIT := tar -xvf $(WEBTARG) && rm $(WEBTARG) +WEBINIT += && mv libpng-*/* png/ +# Instead of autogenning, just turn off zlib link checking during build +AUTOGEN := sed -i -e 's@zlibVersion=no@zlibVersion=yes@g' ./configure +# After configuration, alter the makefile +DFLT_INC := -I. -I$(abspath $(LIBINC_DIR)) -I$(abspath $(LIBDL_DIR)/z) +CONFIGURE += --without-zlib +CONFIGURE += && sed -i -e 's@^DEFAULT_INCLUDES \= \-I\.@DEFAULT_INCLUDES = $(DFLT_INC)@g' ./Makefile +CONFIGURE += && sed -i -e 's@^LIBS \= \-lz@LIBS = -L$(abspath $(LIB_DIR))@g' ./Makefile +# Don't check +MKCMD := make -k diff --git a/make/tiff.mk b/make/tiff.mk new file mode 100644 index 0000000..bbcea4e --- /dev/null +++ b/make/tiff.mk @@ -0,0 +1,12 @@ +################################################################################ +# Desc: libtiff Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# tiff natively supports transpiling +################################################################################ +# Download location +CVSADDR := :pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot +CVSGET := checkout libtiff && rm -Rf tiff && cp -r libtiff/ tiff + +MKCLEAN := echo Implementation needed diff --git a/make/webp.mk b/make/webp.mk new file mode 100644 index 0000000..4d9eab3 --- /dev/null +++ b/make/webp.mk @@ -0,0 +1,9 @@ +################################################################################ +# Desc: webp Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# webp natively supports transpiling +################################################################################ +# Download location +GITADDR := https://chromium.googlesource.com/webm/libwebp diff --git a/make/wolfssl.mk b/make/wolfssl.mk new file mode 100644 index 0000000..3940630 --- /dev/null +++ b/make/wolfssl.mk @@ -0,0 +1,33 @@ +################################################################################ +# Desc: WolfSSL Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# Wolfssl is built for static linking, and only builds its crypt library +################################################################################ +# Download location +GITADDR := git@github.com:wolfSSL/wolfssl.git +# Typical Configuration to allow static linking on a tiny crypt-only lib +CONFIGURE += --enable-static=yes +CONFIGURE += --enable-cryptonly=yes +# Wolfssl has some badly indented text somewhere and a weird distribution system +CONFIGURE += CFLAGS=-w +MKCMD := export CFLAGS=-w +# Only build libwolfssl.la for a minimal distribution (speeds up build) +MKCMD += && make -k src/libwolfssl.la + +# Modifications to the build process when using specific compilers +define emccMOD = +$(eval CONFIGURE += --enable-fastmath=no) +$(eval CONFIGURE += --enable-singlethreaded=yes) +# Wolfssl doesn't properly detect sizeof long and longlong when compiling with +# emscripten +$(eval CONFIGURE += && sed -i 's@SIZEOF_LONG 0@SIZEOF_LONG 4@' config.h) +$(eval CONFIGURE += && sed -i 's@SIZEOF_LONG_LONG 0@SIZEOF_LONG_LONG 8@' config.h) +$(eval MKCMD := $(subst make , emmake make ,$(MKCMD))) +$(eval CONFIGURE := $(subst ./configure , emconfigure ./configure ,$(CONFIGURE))) +endef +define em++MOD = +$(call EMCCMOD) +endef +$(eval $(call $(c_C)MOD)) diff --git a/make/z.mk b/make/z.mk new file mode 100644 index 0000000..af5530a --- /dev/null +++ b/make/z.mk @@ -0,0 +1,11 @@ +################################################################################ +# Desc: zlib Build Data +# Author: Mihrtec LLC +# Date: 2016 +################################################################################ +# zlib natively supports transpiling +################################################################################ +# Download location +GITADDR := https://github.com/madler/zlib.git +# No autogen +undefine AUTOGEN