Added working microwindows for linux.
[fltk_mvc_template.git] / _template / packages / nanox / 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 # compiler flags
10
11 all: unpack linux
12
13 unpack:
14         unzip -o microwindows-master.zip
15         rm -rf $(WORKDIR)/microwindows-master/src/demos/nbreaker
16         rm -rf $(WORKDIR)/microwindows-master/src/demos/nanox/cannyedgedetect.cpp
17         sed -i -e "s/TARGETS +=.*demo-convimage/ /g" $(WORKDIR)/microwindows-master/src/demos/nanox/Makefile
18         sed -i -e "s/TARGETS +=.*demo-agg/ /g" $(WORKDIR)/microwindows-master/src/demos/nanox/Makefile
19
20 windows: unpack
21         cd $(WORKDIR)/nxlib-master; \
22         make CC='$(CC_WIN)' CFLAGS='$(CFLAGS)'
23         mkdir -p $(WORKDIR)/../../lib/mingw32
24         cp -rf $(WORKDIR)/nxlib-master/*.a $(WORKDIR)/../../lib/mingw32
25
26 linux:
27         cp $(WORKDIR)/config_linux $(WORKDIR)/microwindows-master/src/config
28         cd $(WORKDIR)/microwindows-master/src/; \
29         sed -i -e 's/CFLAGS=.*/CFLAGS=-m32/g' ./Makefile.rules; \
30         sed -i -e 's/LDFLAGS=.*/LDFLAGS=-m32/g' ./Makefile.rules; \
31         make -j4
32         mkdir -p $(WORKDIR)/../../lib/linux32
33         cp -rf $(WORKDIR)/microwindows-master/src/lib/*.a $(WORKDIR)/../../lib/linux32
34         cp -rf $(WORKDIR)/microwindows-master/src/include/*.h $(WORKDIR)/../../include
35         cp -rf $(WORKDIR)/microwindows-master/src/nx11/X11-local/* $(WORKDIR)/../../include
36
37 clean:
38         cd $(WORKDIR)/microwindows-master/src; \
39         make clean