Go back to one single main for both pages (to leverage the browser's cache, since a good deal of code will be shared anyway), have GNU Make keep track of all JS depenendencies even in subdirectories, ignore compilation products
This commit is contained in:
parent
16b356a92b
commit
cc8d9e096f
5 changed files with 13 additions and 7 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
game.js
|
||||
index.js
|
||||
main.js
|
||||
skin.css
|
||||
|
|
8
Makefile
8
Makefile
|
@ -1,12 +1,14 @@
|
|||
PACKAGES=unitJS
|
||||
TARGETS=index.js game.js skin.css
|
||||
SRC=js
|
||||
JS_CODE=$(shell find $(SRC) -type f -name '*.js')
|
||||
TARGETS=main.js skin.css
|
||||
|
||||
.PHONY: mrproper
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
%.js: js/
|
||||
sjw -o $@ $(PACKAGES:%=-I %) -m Main.$(@:%.js=%) $^
|
||||
main.js: $(JS_CODE)
|
||||
sjw -o $@ $(PACKAGES:%=-I %) $(SRC)
|
||||
|
||||
skin.css: skin/
|
||||
cat $^*.css > $@
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>KoiKoi</title>
|
||||
<script src="game.js"></script>
|
||||
<script src="main.js"></script>
|
||||
<link rel="stylesheet" href="skin.css" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>KoiKoi</title>
|
||||
<script src="index.js"></script>
|
||||
<script src="main.js"></script>
|
||||
<link rel="stylesheet" href="skin.css" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
|
5
js/Main.js
Normal file
5
js/Main.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import * as Login from GUI.Screen.Login;
|
||||
import * as Hall from GUI.Screen.Hall;
|
||||
|
||||
Login.init();
|
||||
Hall.init();
|
Loading…
Reference in a new issue