Added nanux receipe
[fltk_mvc_template.git] / _template / packages / fltk1.3 / Makefile
1 ############################################################################
2 # Workfile: Makefile
3 # Author: Daniel Giritzer, S1810567004 (daniel@giritzer.eu)
4 # Date: 03.12.2018
5 # Description: Universal Makefile for Unix based Operating Systems
6 ############################################################################
7 WORKDIR = $(shell pwd)
8
9 all: unpack windows clean linux
10
11 .PHONY: unpack
12 unpack:
13         tar xvzf fltk-1.3.4-1-source.tar.gz
14         cd $(WORKDIR)/fltk-1.3.4-1
15
16 .PHONY: windows
17 windows:
18         cd $(WORKDIR)/fltk-1.3.4-1; \
19         ./configure CFLAGS="-m32 -mwindows" CXXFLAGS="-m32 -mwindows" LDFLAGS="-m32 -static -static-libgcc -static-libstdc++ -lpthread"  --enable-static --host=i686-w64-mingw32 --enable-cygwin --enable-localjpeg --enable-localzlib --enable-localpng --disable-xcursor --disable-xinerama --disable-xft --disable-xdbe --disable-xrender --disable-xfixes; \
20         make -j4
21         mkdir -p $(WORKDIR)/../../include
22         mkdir -p $(WORKDIR)/../../lib/mingw32
23         cp -rf $(WORKDIR)/fltk-1.3.4-1/FL $(WORKDIR)/../../include
24         cp -rf $(WORKDIR)/fltk-1.3.4-1/lib/* $(WORKDIR)/../../lib/mingw32
25
26 .PHONY: linux
27 linux:
28         cd $(WORKDIR)/fltk-1.3.4-1; \
29         ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static-libgcc -static-libstdc++" --enable-static --enable-localjpeg --enable-localzlib --enable-localpng --disable-xcursor --disable-xinerama --disable-xft --disable-xdbe --disable-xrender --disable-xfixes; \
30         make -j4
31         mkdir -p $(WORKDIR)/../../include
32         mkdir -p $(WORKDIR)/../../lib/linux32
33         cp -rf $(WORKDIR)/fltk-1.3.4-1/FL $(WORKDIR)/../../include
34         cp -rf $(WORKDIR)/fltk-1.3.4-1/lib/* $(WORKDIR)/../../lib/linux32
35
36 .PHONY: linux_nanox
37 linux_nanox:
38         cd $(WORKDIR)/fltk-1.3.4-1; \
39         ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static-libgcc -static-libstdc++" --enable-static --x-includes=../../../../include/X11  --x-libraries=../../../../lib/linux32 --enable-localjpeg --enable-localzlib --enable-localpng --disable-gl --disable-xinerama --disable-xft --disable-xdbe --disable-xfixes --disable-xcursor --disable-xrender; \
40         sed -i -e 's/-lX11/-lNX11 -lnano-X/g' ./makeinclude; \
41         sed -i -e 's/-lX11/-lNX11 -lnano-X/g' ./fltk-config; \
42         sed -i -e '/#define USE_XRANDR/ a #undef USE_XRANDR' ./src/Fl_x.cxx; \
43         sed -i -e '/#define USE_XRANDR/ a #undef USE_XRANDR' ./src/screen_xywh.cxx; \
44         make -k -j4
45         mkdir -p $(WORKDIR)/../../include
46         mkdir -p $(WORKDIR)/../../lib/linux32
47         cp -rf $(WORKDIR)/fltk-1.3.4-1/FL $(WORKDIR)/../../include
48         cp -rf $(WORKDIR)/fltk-1.3.4-1/lib/*.a $(WORKDIR)/../../lib/linux32
49
50 .PHONY: clean
51 clean:
52         cd $(WORKDIR)/fltk-1.3.4-1; \
53         make clean