| 1 | #!/usr/bin/make -f |
| 2 | |
| 3 | commascip-makefile . . . comma. := , |
| 4 | emptyscip-makefile . . . empty. := |
| 5 | spacescip-makefile . . . space. := $(emptyscip-makefile . . . empty.) $(emptyscip-makefile . . . empty.) |
| 6 | |
| 7 | EXTERNALscip-makefile . . . EXTERNAL. = path-to-regexp,delegate-it,typed-query-selector,focus-options-polyfill |
| 8 | GLOBALSscip-makefile . . . GLOBALS. = path-to-regexp:pathToRegexp,delegate-it:delegateIt,typed-query-selector:typedQuerySelector,focus-options-polyfill:focusOptionsPolyfill,swup:swup,@swup/plugin:swupPlugin |
| 9 | MODULESscip-makefile . . . MODULES. = -p babel -p typescript -p json -p terser |
| 10 | PLUGINSscip-makefile . . . PLUGINS. = a11y-plugin progress-plugin |
| 11 | PLUGINVARSscip-makefile . . . PLUGINVARS. = a11y-plugin:swupA11yPlugin,progress-plugin:swupProgressPlugin |
| 12 | INDEXscip-makefile . . . INDEX. = src/index.ts |
| 13 | |
| 14 | %scip-makefile . . . `%`/: |
| 15 | dh $@scip-makefile . . . `@`. |
| 16 | |
| 17 | override_dh_auto_configurescip-makefile . . . override_dh_auto_configure/: |
| 18 | |
| 19 | override_dh_auto_buildscip-makefile . . . override_dh_auto_build/: |
| 20 | mkdir -p node_modules/@swup |
| 21 | # link external modules |
| 22 | for p in $(subst $(commascip-makefile . . . comma.),$(spacescip-makefile . . . space.),$(EXTERNALscip-makefile . . . EXTERNAL.)) ; do \ |
| 23 | ln -s /usr/share/nodejs/$$p node_modules/$$p ; \ |
| 24 | done |
| 25 | # swup |
| 26 | rollup $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.) -g $(GLOBALSscip-makefile . . . GLOBALS.) -f cjs $(INDEXscip-makefile . . . INDEX.) -o dist/Swup.cjs -m |
| 27 | rollup $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.) -g $(GLOBALSscip-makefile . . . GLOBALS.) -f es $(INDEXscip-makefile . . . INDEX.) -o dist/Swup.module.js -m |
| 28 | rollup -c rollup.modern.mjs $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.) -g $(GLOBALSscip-makefile . . . GLOBALS.) -f es $(INDEXscip-makefile . . . INDEX.) -o dist/Swup.modern.js -m |
| 29 | rollup $(MODULESscip-makefile . . . MODULES.) -e none -g $(GLOBALSscip-makefile . . . GLOBALS.) -f umd src/Swup.ts -o dist/Swup.umd.js -m -n swup |
| 30 | ln -s ../dist node_modules/swup |
| 31 | # @swup/plugin |
| 32 | cd plugin && \ |
| 33 | rollup $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.),swup -g $(GLOBALSscip-makefile . . . GLOBALS.) -f cjs $(INDEXscip-makefile . . . INDEX.) -o dist/index.cjs -m |
| 34 | cd plugin && \ |
| 35 | rollup $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.),swup -g $(GLOBALSscip-makefile . . . GLOBALS.) -f es $(INDEXscip-makefile . . . INDEX.) -o dist/index.module.js -m |
| 36 | cd plugin && \ |
| 37 | rollup -c ../rollup.modern.mjs $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.),swup -g $(GLOBALSscip-makefile . . . GLOBALS.) -f es $(INDEXscip-makefile . . . INDEX.) --o dist/index.modern.js -m |
| 38 | cd plugin && \ |
| 39 | rollup $(MODULESscip-makefile . . . MODULES.) -e none -g $(GLOBALSscip-makefile . . . GLOBALS.) -f umd $(INDEXscip-makefile . . . INDEX.) -o dist/index.umd.js -m -n swupPlugin |
| 40 | ln -s ../plugin/dist node_modules/@swup/plugin |
| 41 | # plugins |
| 42 | for p in $(PLUGINSscip-makefile . . . PLUGINS.) ; do \ |
| 43 | (cd $$p && \ |
| 44 | rollup $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.),swup,@swup/plugin -g $(GLOBALSscip-makefile . . . GLOBALS.) -f cjs $(INDEXscip-makefile . . . INDEX.) -o dist/index.cjs -m) || \ |
| 45 | exit 1 ; \ |
| 46 | done |
| 47 | for p in $(PLUGINSscip-makefile . . . PLUGINS.) ; do \ |
| 48 | (cd $$p && \ |
| 49 | rollup $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.),swup,@swup/plugin -g $(GLOBALSscip-makefile . . . GLOBALS.) -f es $(INDEXscip-makefile . . . INDEX.) -o dist/index.module.js -m) || \ |
| 50 | exit 1 ; \ |
| 51 | done |
| 52 | for p in $(PLUGINSscip-makefile . . . PLUGINS.) ; do \ |
| 53 | (cd $$p && \ |
| 54 | rollup -c ../rollup.modern.mjs $(MODULESscip-makefile . . . MODULES.) -e $(EXTERNALscip-makefile . . . EXTERNAL.),swup,@swup/plugin -g $(GLOBALSscip-makefile . . . GLOBALS.) -f es $(INDEXscip-makefile . . . INDEX.) -o dist/index.modern.js -m) || \ |
| 55 | exit 1 ; \ |
| 56 | done |
| 57 | for p in $(PLUGINSscip-makefile . . . PLUGINS.) ; do \ |
| 58 | (cd $$p && \ |
| 59 | rollup $(MODULESscip-makefile . . . MODULES.) -e none -g $(GLOBALSscip-makefile . . . GLOBALS.) -f umd $(INDEXscip-makefile . . . INDEX.) -o dist/index.umd.js -m \ |
| 60 | -n $$(echo ",$(PLUGINVARSscip-makefile . . . PLUGINVARS.)," | sed -e "s/.*,$$p:\\([^,]*\\),.*/\\1/")) || \ |
| 61 | exit 1 ; \ |
| 62 | done |
| 63 | |
| 64 | override_dh_auto_installscip-makefile . . . override_dh_auto_install/: |
| 65 | dh_auto_install --buildsystem=nodejs |
| 66 | mv debian/node-swup/usr/share/nodejs/swup/node_modules/* debian/node-swup/usr/share/nodejs/ |
| 67 | rmdir debian/node-swup/usr/share/nodejs/swup/node_modules |
| 68 | |
| 69 | override_dh_installchangelogsscip-makefile . . . override_dh_installchangelogs/: |
| 70 | dh_installchangelogs -X CHANGELOG.md |
| 71 | |
| 72 | .PHONYscip-makefile . . . `.PHONY`/: override_dh_auto_configurescip-makefile . . . override_dh_auto_configure/ override_dh_auto_buildscip-makefile . . . override_dh_auto_build/ \ |
| 73 | override_dh_auto_install override_dh_installchangelogs |