updates
[mTask.git] / Makefile
index 866a77f..ab55386 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,12 @@
 CLEAN_HOME?=/opt/clean
 CLM:=clm
-override CLMFLAGS+=-dynamics -h 200M -nt -l -no-pie
+
+override CLMFLAGS+=-dynamics -h 200M -nt
+GCCVERSIONGTEQ6:=$(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 6)
+ifeq "$(GCCVERSIONGTEQ6)" "1"
+       override CLMFLAGS+=-l -no-pie
+endif
+
 CLMLIBS:=\
        -I $(CLEAN_HOME)/lib/Platform\
        -I $(CLEAN_HOME)/lib/Platform/Deprecated/StdLib\
@@ -13,21 +19,23 @@ CLMLIBS:=\
        -I $(CLEAN_HOME)/lib/TCPIP\
        -I ./CleanSerial
 
-BINARIES:= mTaskExamples mTaskInterpret miTask
+BINARIES:= miTask mTaskExamples mTaskInterpret
 
-all: CleanSerial/Clean\ System\ Files/TTY.o $(BINARIES) int/mTaskSymbols.h
+all: CleanSerial/Clean\ System\ Files/TTY.o $(BINARIES) client/mTaskSymbols.h
+       mkdir -p miTask-www
+       find $(CLEAN_HOME)/lib -path '*/WebPublic/*' -not -path '*/CodeMirror/*' -execdir cp -nR {} "$$PWD"/miTask-www/ \;
 
 CleanSerial/Clean\ System\ Files/TTY.o:
        make -C CleanSerial
 
-
-int/mTaskSymbols.h: mTaskMakeSymbols
+client/mTaskSymbols.h: mTaskMakeSymbols
+       mkdir -p client
        ./$< -nr > $@
 
-%: %.icl $(wildcard *.[id]cl)
+%: %.icl $(wildcard */*.[id]cl *.[id]cl)
        $(CLM) $(CLMLIBS) $(CLMFLAGS) $(basename $<) -o $@
 
-
 clean:
-       $(RM) -r $(BINARIES) Clean\ System\ Files miTask-data
+       $(RM) -r $(BINARIES) Clean\ System\ Files miTask-data miTask-www
+       find . -type d -name 'Clean System Files' -print0 | xargs -r0 rm -r
        make -C CleanSerial clean