Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Compilation architecture + plugin with jQueryUI sources.

  • Loading branch information...
commit c490cebb393624fb412ef86c9d12821a48ccd15d 0 parents
@akoprow akoprow authored
5 .gitignore
@@ -0,0 +1,5 @@
+_build
+_tracks
+*.exe
+*~
+*.broken
33 Makefile
@@ -0,0 +1,33 @@
+########################################
+# USER VARIABLES
+
+EXE = demo.exe
+PACKNAME =
+SRC =
+MAINSRC = demo.opa
+PCKDIR = ./packages/
+PCK = jQueryUI.opx
+PLUGIN =
+PLUGINDIR =
+OTHER_DEPENDS =
+
+#Compiler variables
+OPACOMPILER = opa
+MINIMAL_VERSION = 1150
+FLAG = --minimal-version $(MINIMAL_VERSION) -v
+PORT = 8080
+
+RUNOPT ?= #-d --debug-js
+
+# Build exe
+default: exe
+
+# Generate doc ApiX
+gen: exe
+ ./$(EXE) -g $(OPALANG)/_build/stdlib
+
+# Run Server
+run: exe
+ ./$(EXE) $(RUNOPT) || exit 0 ## prevent ugly make error 130 :) ##
+
+include Makefile.common
86 Makefile.common
@@ -0,0 +1,86 @@
+########################################
+# MAKEFILE VARIABLES
+OPA = $(OPACOMPILER) $(FLAG) $(OPAOPT)
+PWD ?= $(shell pwd)
+BUILDDIR ?= $(PWD)/_build
+export BUILDDIR
+BUILDDOCDIR ?=$(PWD)/doc/
+export BUILDDOCDIR
+PACKDOC = $(BUILDDOCDIR)/$(PACKNAME:%.opx=%.doc)/
+BUILDDOC = $(PACKDOC)
+OPACOMPILER ?= opa
+OPAGENAPI ?= $(OPACOMPILER) --api-only
+OPADOC ?= opadoc-gen.exe
+DEPENDS = $(SRC) $(PCK:%=$(BUILDDIR)/%) $(PLUGIN:%=$(BUILDDIR)/%)
+
+ifdef CONF_FILE
+ CONFIG = --conf $(CONF_FILE)
+else
+ CONFIG =
+endif
+
+_ = $(shell mkdir -p $(BUILDDIR))
+
+########################################
+# MAIN RULE
+exe : $(EXE)
+pack : $(PACKNAME)
+doc : $(PACKDOC) doc.sub
+
+########################################
+# MAIN PACKAGE BUILDING
+$(PACKNAME) : $(BUILDDIR)/$(PACKNAME)
+
+$(BUILDDIR)/$(PACKNAME) : $(DEPENDS)
+ @echo "### Building package $(PACKNAME)"
+ mkdir -p $(BUILDDIR)
+ $(OPA) --autocompile $(SRC) $(PLUGIN:%=$(BUILDDIR)/%) --build-dir $(BUILDDIR) -I $(BUILDDIR) $(OPAOPT)
+ @rm -rf $(BUILDDIR)/$(PACKNAME)
+ @mv $(PACKNAME) $(BUILDDIR)/
+
+########################################
+# SUBS PACKAGE/PLUGIN BUILDING
+$(BUILDDIR)/%.opx :
+ make $(@:$(BUILDDIR)/%.opx=-C $(PCKDIR)/%) pack
+
+$(BUILDDIR)/%.opp :
+ make $(@:$(BUILDDIR)/%.opp=-C $(PLUGINDIR)/%)
+
+########################################
+# EXECUTABLE BUILDING
+$(EXE) : pack $(SRC) $(MAINSRC) $(DEPENDS) $(OTHER_DEPENDS)
+ @echo "### Building executable $(EXE) "
+ mkdir -p $(BUILDDIR)
+ $(OPA) $(COMPILOPT) $(MAINSRC) $(CONFIG) $(PLUGIN:%=$(BUILDDIR)/%) -o $@ -I $(BUILDDIR) --build-dir $(BUILDDIR)/$(EXE)
+
+$(EXE:%.exe=%.run) : $(EXE)
+ ./$(EXE) -p $(PORT)
+
+########################################
+# DOCUMENTATION BUILDING - Dirty...
+$(PACKDOC) :
+ @echo "### Building documentation $(PACKNAME:%.opx=%.doc)"
+ @mkdir -p $(BUILDDOC)
+ @$(OPACOMPILER) $(SRC) $(PLUGIN:%=$(BUILDDIR)/%) --api-only -I $(BUILDDIR)
+ @mv $(SRC:%=%.api) $(SRC:%=%.api-txt) $(BUILDDOC)
+ @cp $(SRC) $(BUILDDOC)
+ @cd $(BUILDDOC) && $(OPADOC) .
+ @mkdir -p $(PACKDOC)
+ @mv doc/*.html doc/*.css $(PACKDOC)
+
+doc.sub :
+ @if [ -n "$(PCK)" ]; then make $(PCK:%.opx=-C $(PCKDIR)/%) doc; fi
+
+########################################
+# Used by recursives makefile
+pack.depends :
+ @echo $(PCK) $(PLUGIN)
+
+########################################
+# CLEANING
+clean ::
+ @$(PCK:%.opx=make -C $(PCKDIR)/% clean &&) $(PLUGIN:%.opp=make -C $(PLUGINDIR)/% clean &&) echo "### Cleaning $(BUILDDIR)";
+ @rm -rf $(BUILDDIR) _tracks *.broken;
+ @if [ -n "$(EXE)" ]; then rm -rf $(EXE); fi
+ @if [ -n "$(PACKDOC)" ]; then rm -rf $(PACKDOC); fi
+
0  demo.opa
No changes.
10 packages/jQueryUI/Makefile
@@ -0,0 +1,10 @@
+########################################
+# USER VARIABLES
+PACKNAME = jQueryUI.opx
+SRC = jQueryUI.opa
+PLUGIN = jQueryUI.opp
+PLUGINDIR = ./
+
+all: pack
+
+include Makefile.common
1  packages/jQueryUI/Makefile.common
5 packages/jQueryUI/jQueryUI.opa
@@ -0,0 +1,5 @@
+package jQueryUI
+
+module jQueryUI {
+
+}
26 packages/jQueryUI/jQueryUI/Makefile
@@ -0,0 +1,26 @@
+########################################
+# USER VARIABLES
+MKLIB = opa-plugin-builder
+PLUGNAME = jQueryUI.opp
+SRC = ui/jquery-ui.js
+
+########################################
+# MAKEFILE VARIABLES
+ifeq ($(origin BUILDDIR), undefined)
+ PWD := $(shell pwd)
+ BUILDDIR := $(PWD)/_build/
+ export BUILDDIR
+endif
+
+########################################
+# PLUGIN BUILDING
+$(PLUGNAME) : $(SRC)
+ @echo "### Building plugin $(PLUGNAME)"
+ @$(MKLIB) --js-validator-off -o $(@:%.opp=%) $? $(CONF) --build-dir $(BUILDDIR)
+
+########################################
+# CLEANING
+clean :
+ @echo "### Cleaning plugin $(PLUGNAME)"
+ @rm -rf $(BUILDDIR)/$(PLUGNAME)
+
1  packages/jQueryUI/jQueryUI/ui
Please sign in to comment.
Something went wrong with that request. Please try again.