2011-06-19 21:18:50 -07:00
|
|
|
JAVAEA=java -ea -Xms256M -Xmx256M -Ddebug=true
|
2011-07-08 01:11:44 -07:00
|
|
|
LIBS=.
|
2011-07-27 22:02:13 -07:00
|
|
|
JAVA=java -Xms256M -Xmx256M -Ddebug=true -Dcom.sun.management.jmxremote -cp $(LIBS):release/Magarena.jar
|
2011-06-09 01:23:52 -07:00
|
|
|
SHELL=/bin/bash
|
2011-05-24 20:10:09 -07:00
|
|
|
BUILD=build
|
2011-07-08 01:11:44 -07:00
|
|
|
JOPTS=-Xlint:all -d $(BUILD) -cp $(LIBS):$(BUILD):.
|
|
|
|
SRC=$(shell find src -iname *.java)
|
2011-05-22 19:52:01 -07:00
|
|
|
MAG:=release/Magarena.jar
|
|
|
|
EXE:=release/Magarena.exe
|
2011-05-22 19:23:49 -07:00
|
|
|
|
2011-05-22 19:52:01 -07:00
|
|
|
all: $(MAG) $(EXE) tags
|
|
|
|
|
2011-08-26 05:22:21 -07:00
|
|
|
check_literals:
|
|
|
|
grep "\"" src/magic/card/* | awk -f scripts/check_literals.awk
|
|
|
|
|
2011-08-24 23:24:57 -07:00
|
|
|
cubes: \
|
|
|
|
release/mods/legacy_cube.txt \
|
|
|
|
release/mods/extended_cube.txt \
|
|
|
|
release/mods/standard_cube.txt \
|
|
|
|
release/mods/modern_cube.txt
|
2011-06-09 19:09:19 -07:00
|
|
|
|
2011-08-25 23:40:03 -07:00
|
|
|
themes: \
|
|
|
|
release/mods/felt_theme.zip \
|
|
|
|
release/mods/blackswamp_theme.zip \
|
|
|
|
release/mods/bluemarble_theme.zip \
|
|
|
|
release/mods/darkbattle_theme.zip \
|
|
|
|
release/mods/gothic_theme.zip \
|
|
|
|
release/mods/greenforest_theme.zip \
|
|
|
|
release/mods/moon_theme.zip \
|
|
|
|
release/mods/mystic_theme.zip \
|
|
|
|
release/mods/nature_theme.zip \
|
|
|
|
release/mods/redfire_theme.zip \
|
|
|
|
release/mods/whiteangel_theme.zip
|
|
|
|
|
2011-06-09 19:09:19 -07:00
|
|
|
release/mods/legacy_cube.txt: cards/existing.txt cards/legacy_banned.txt
|
|
|
|
join -v1 -t"|" <(sort $(word 1,$^)) <(sort $(word 2,$^)) > $@
|
|
|
|
|
2011-08-24 23:24:57 -07:00
|
|
|
release/mods/%_cube.txt: cards/existing.txt cards/%_all.txt
|
2011-06-09 01:23:52 -07:00
|
|
|
join -t"|" <(sort $(word 1,$^)) <(sort $(word 2,$^)) > $@
|
|
|
|
|
2011-08-24 23:24:57 -07:00
|
|
|
cards/modern_all.txt:
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D0+f%3Amodern&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' > $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D1+f%3Amodern&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D2+f%3Amodern&s=cname&v=olist&p=1" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D2+f%3Amodern&s=cname&v=olist&p=2" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D3+f%3Amodern&s=cname&v=olist&p=1" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D3+f%3Amodern&s=cname&v=olist&p=2" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D4+f%3Amodern&s=cname&v=olist&p=1" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D4+f%3Amodern&s=cname&v=olist&p=2" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D5+f%3Amodern&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc>%3D6+f%3Amodern&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
2011-06-09 01:23:52 -07:00
|
|
|
|
2011-06-09 19:00:24 -07:00
|
|
|
cards/extended_all.txt:
|
2011-08-24 23:15:58 -07:00
|
|
|
curl "http://magiccards.info/query?q=cmc%3D0+f%3Aextended&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' > $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D1+f%3Aextended&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D2+f%3Aextended&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D3+f%3Aextended&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D4+f%3Aextended&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc%3D5+f%3Aextended&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
curl "http://magiccards.info/query?q=cmc>%3D6+f%3Aextended&s=cname&v=olist" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
2011-06-09 01:23:52 -07:00
|
|
|
|
2011-06-09 19:00:24 -07:00
|
|
|
cards/standard_all.txt:
|
2011-06-09 01:23:52 -07:00
|
|
|
curl "http://magiccards.info/query?q=f%3Astandard&s=cname&v=olist&p=1" | grep "en/" | sed 's/<[^>]*>//g' > $@
|
|
|
|
curl "http://magiccards.info/query?q=f%3Astandard&s=cname&v=olist&p=2" | grep "en/" | sed 's/<[^>]*>//g' >> $@
|
|
|
|
|
2011-06-09 19:00:24 -07:00
|
|
|
cards/existing.txt: resources/magic/data/cards.txt resources/magic/data/cards2.txt
|
2011-06-02 00:03:14 -07:00
|
|
|
cat $^ | grep "^>" | sed 's/>//' | sort > $@
|
|
|
|
|
2011-07-10 20:02:02 -07:00
|
|
|
cards/existing_full.txt: newcards/existing.txt cards/mtg-data.txt
|
2011-06-02 00:03:14 -07:00
|
|
|
awk -f scripts/extract_existing.awk $^ > $@
|
|
|
|
|
2011-07-10 20:02:02 -07:00
|
|
|
cards/candidates_full.txt: scripts/extract_candidates.awk cards/candidates.txt cards/mtg-data.txt
|
2011-06-02 19:29:35 -07:00
|
|
|
awk -f $^ | sort -rg | sed 's/\t/\n/g' > $@
|
|
|
|
|
2011-06-06 20:19:30 -07:00
|
|
|
%.out: $(MAG)
|
2011-06-10 23:03:02 -07:00
|
|
|
SGE_TASK_ID=$* exp/eval_mcts.sh
|
2011-06-06 19:16:09 -07:00
|
|
|
|
2011-06-01 02:06:18 -07:00
|
|
|
M1.%:
|
2011-08-26 03:42:36 -07:00
|
|
|
grep "VERSION.*1.$*" -r src/*
|
2011-05-29 18:51:10 -07:00
|
|
|
-rm -rf Magarena-1.$*
|
|
|
|
-rm Magarena-1.$*.zip
|
2011-05-29 19:04:45 -07:00
|
|
|
mkdir -p Magarena-1.$*/Magarena/mods
|
2011-05-27 00:34:47 -07:00
|
|
|
cp \
|
|
|
|
release/gpl-3.0.html \
|
|
|
|
release/Magarena.exe \
|
|
|
|
release/Magarena.sh \
|
|
|
|
release/Magarena.command \
|
|
|
|
release/README.txt \
|
2011-05-29 18:51:10 -07:00
|
|
|
Magarena-1.$*
|
2011-05-29 18:46:41 -07:00
|
|
|
cp -r \
|
|
|
|
release/avatars \
|
|
|
|
release/decks \
|
|
|
|
release/sounds \
|
2011-05-29 18:51:10 -07:00
|
|
|
Magarena-1.$*/Magarena
|
2011-05-29 19:04:45 -07:00
|
|
|
cp \
|
|
|
|
release/mods/felt_theme.zip \
|
2011-06-20 00:34:15 -07:00
|
|
|
release/mods/*.txt \
|
2011-05-29 19:04:45 -07:00
|
|
|
Magarena-1.$*/Magarena/mods
|
2011-05-29 18:51:10 -07:00
|
|
|
-zip -r Magarena-1.$*.zip Magarena-1.$*
|
2011-05-27 00:34:47 -07:00
|
|
|
|
2011-05-22 19:52:01 -07:00
|
|
|
$(MAG): $(SRC)
|
2011-05-24 19:22:08 -07:00
|
|
|
ant
|
2011-05-22 19:52:01 -07:00
|
|
|
|
2011-06-10 06:43:32 -07:00
|
|
|
class: $(BUILD)/javac.last
|
|
|
|
|
2011-05-24 20:10:09 -07:00
|
|
|
$(BUILD)/javac.last: $(SRC)
|
|
|
|
-mkdir $(BUILD)
|
|
|
|
javac $(JOPTS) $?
|
2011-05-24 20:57:28 -07:00
|
|
|
cp -r resources/* $(BUILD)
|
2011-05-24 20:10:09 -07:00
|
|
|
touch $@
|
|
|
|
|
2011-05-22 19:52:01 -07:00
|
|
|
tags: $(SRC)
|
|
|
|
ctags -R .
|
2011-05-22 19:23:49 -07:00
|
|
|
|
2011-05-29 22:13:32 -07:00
|
|
|
.Test%: $(MAG)
|
2011-06-17 21:11:53 -07:00
|
|
|
$(JAVA) -DtestGame=Test$* -jar $^
|
2011-05-28 00:47:06 -07:00
|
|
|
|
2011-05-22 19:52:01 -07:00
|
|
|
$(EXE): $(MAG)
|
2011-05-24 19:22:08 -07:00
|
|
|
cd launch4j; ./launch4j ../release/magarena.xml
|
2011-05-22 19:40:28 -07:00
|
|
|
|
2011-05-22 19:23:49 -07:00
|
|
|
clean:
|
2011-05-24 20:10:09 -07:00
|
|
|
-ant clean
|
|
|
|
-rm $(BUILD)/javac.last
|
2011-05-28 00:47:06 -07:00
|
|
|
-rm $(MAG)
|
|
|
|
|
2011-06-03 21:05:18 -07:00
|
|
|
jar: $(MAG)
|
2011-06-14 02:36:44 -07:00
|
|
|
$(JAVA) -jar $^
|
2011-05-22 19:23:49 -07:00
|
|
|
|
2011-06-20 00:12:39 -07:00
|
|
|
%.g: $(MAG)
|
2011-07-08 01:11:44 -07:00
|
|
|
$(JAVA) -DrndSeed=$* magic.MagicMain |& tee $*.log
|
2011-06-11 03:01:24 -07:00
|
|
|
|
2011-07-26 20:36:20 -07:00
|
|
|
%.t: $(MAG)
|
2011-07-31 20:38:47 -07:00
|
|
|
echo `hg id -n` > $*.log
|
|
|
|
$(JAVA) -DrndSeed=$* -DselfMode magic.MagicMain |& tee -a $*.log
|
2011-07-26 20:36:20 -07:00
|
|
|
|
2011-06-27 02:16:19 -07:00
|
|
|
%.d: $(MAG)
|
|
|
|
$(JAVAEA) -DrndSeed=$* -jar $^ |& tee $*.log
|
|
|
|
|
2011-05-22 19:23:49 -07:00
|
|
|
test: $(MAG)
|
2011-06-14 02:36:44 -07:00
|
|
|
$(JAVA) -DrndSeed=123 magic.DeckStrCal \
|
2011-05-24 02:05:39 -07:00
|
|
|
--deck1 release/decks/LSK_G.dec \
|
|
|
|
--ai1 VEGAS \
|
|
|
|
--deck2 release/decks/LSK_G.dec \
|
2011-05-22 19:23:49 -07:00
|
|
|
--ai2 RND --games 10 --strength 3
|
|
|
|
|
2011-05-22 23:07:49 -07:00
|
|
|
exp/%.log: $(MAG)
|
2011-05-23 01:01:33 -07:00
|
|
|
scripts/evaluate_ai.sh $* > $@
|
2011-06-01 02:06:18 -07:00
|
|
|
|
2011-06-03 21:05:18 -07:00
|
|
|
decks/dd_%.dec: scripts/dailyhtml2dec.awk
|
|
|
|
curl "http://www.wizards.com/Magic/Magazine/Article.aspx?x=mtg/daily/deck/$*" | awk -f $^ > $@
|
|
|
|
|
|
|
|
decks/ml_%.dec: scripts/apprentice2dec.awk
|
|
|
|
wget "http://www.magic-league.com/decks/download.php?deck=$*&index=1" -O - | flip -u - | awk -f $^ > $@
|
2011-06-18 08:42:56 -07:00
|
|
|
|
|
|
|
# Mike Flores 1 - 212
|
|
|
|
decks/mf_%.dec: scripts/dailyhtml2dec.awk
|
|
|
|
curl http://www.wizards.com/Magic/Magazine/Article.aspx?x=mtgcom/daily/mf$* | awk -f $^ > $@
|
|
|
|
|
|
|
|
# Top Decks 1 - 147
|
|
|
|
decks/td_%.dec: scripts/dailyhtml2dec.awk
|
|
|
|
curl http://www.wizards.com/Magic/Magazine/Article.aspx?x=mtg/daily/td/$* | awk -f $^ > $@
|
2011-06-19 23:06:10 -07:00
|
|
|
|
|
|
|
ref/rules.txt:
|
|
|
|
curl http://www.wizards.com/magic/comprules/MagicCompRules_20110617.txt | fmt -s > $@
|
|
|
|
flip -u $@
|
2011-06-20 18:58:22 -07:00
|
|
|
|
|
|
|
resources/magic/data/icons/missing_card.png:
|
2011-06-20 19:27:14 -07:00
|
|
|
convert -background gray -bordercolor black -border 5x5 -size 302x435 \
|
|
|
|
-pointsize 30 label:'\nNo card image found\n\nSelect\n\"Download images\"\nfrom Arena menu\n\nOR\n\nSwitch to text mode\nusing the Enter key' $@
|
2011-06-22 19:02:22 -07:00
|
|
|
|
|
|
|
release/mods/%_theme.zip: release/mods/%_theme
|
|
|
|
zip -j $@ $^/*
|
2011-06-24 00:01:27 -07:00
|
|
|
|
|
|
|
cards/evan_cube.txt:
|
|
|
|
curl http://www.cubedrafting.com/view-the-cube/ | grep jTip | sed "s/<[^>]*>//g;s/\&\#8217;/'/" > $@
|
|
|
|
|
|
|
|
cards/brett_cube.txt:
|
|
|
|
curl http://www.snazzorama.com/magic/cube/ | grep ":WizardsAutoCard" | sed "s/<\/td>.*//;s/<[^>]*>//g;s/\&\#8217;/'/" > $@
|
2011-06-28 19:05:50 -07:00
|
|
|
|
2011-06-28 20:07:08 -07:00
|
|
|
cards/tom_cube.txt:
|
|
|
|
wget -O - http://www.tomlapille.com/cube/tom_list.html | sed 's/<[^>]*>//g;s/^[ ]*//g;/^$$/d' > $@
|
|
|
|
|
|
|
|
cards/adam_cube.txt:
|
|
|
|
wget -O - http://www.tomlapille.com/cube/adam_list.html | sed 's/<[^>]*>//g;s/^[ ]*//g;/^$$/d' > $@
|
|
|
|
|
|
|
|
cards/AWinnarIsYou_cube.txt:
|
|
|
|
wget -O - http://www.tomlapille.com/cube/winnar_list.html | sed 's/<[^>]*>//g;s/^[ ]*//g;/^$$/d' > $@
|
2011-06-28 19:05:50 -07:00
|
|
|
|
|
|
|
daily: $(EXE)
|
|
|
|
mv $^ Magarena_`hg id -n`.exe
|
2011-07-31 20:38:47 -07:00
|
|
|
scripts/googlecode_upload.py \
|
|
|
|
-s "build `hg id -n`" \
|
|
|
|
-p magarena \
|
|
|
|
-u melvinzhang@gmail.com \
|
|
|
|
-w `cat ~/Modules/notes/keys/googlecode_pw.txt` \
|
|
|
|
Magarena_`hg id -n`.exe
|
2011-07-01 00:39:22 -07:00
|
|
|
|
2011-07-10 20:02:02 -07:00
|
|
|
cards/scriptable.txt: scripts/analyze_cards.scala scripts/effects.txt cards/cards.xml
|
2011-07-01 19:51:19 -07:00
|
|
|
scala $^ > $@ 2> cards/others.txt
|
2011-07-18 20:01:09 -07:00
|
|
|
|
|
|
|
cards/magicdraftsim-rating: cards/card-ratings
|
|
|
|
for i in `cat $^`; do \
|
|
|
|
curl http://www.magicdraftsim.com/card-ratings/$$i | \
|
|
|
|
html2text | \
|
|
|
|
grep "^[0-9]" | \
|
|
|
|
sed "s/^[0-9]*/$$i/"; \
|
|
|
|
done > $@
|
2011-07-28 19:44:02 -07:00
|
|
|
|
2011-08-08 01:50:36 -07:00
|
|
|
cards/current-magic-excel.txt:
|
|
|
|
wget http://www.magictraders.com/pricelists/current-magic-excel.txt -O $@
|
2011-08-09 21:50:25 -07:00
|
|
|
|
|
|
|
pull-beholder:
|
|
|
|
hg pull https://code.google.com/r/beholder1-magarena/
|