lahmanlite/Makefile

90 lines
5.4 KiB
Makefile
Raw Normal View History

2024-05-05 03:46:30 +00:00
# Copyright (C) 2024 filifa
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
2024-01-25 05:44:50 +00:00
.PHONY: db
2024-05-05 03:11:20 +00:00
db: lahman.db
2024-01-25 05:44:50 +00:00
2024-05-05 03:11:20 +00:00
lahman.db: lahman-raw.db sql/awards.sql sql/franchises.sql sql/teamseasons.sql sql/seasons.sql sql/parks.sql sql/collegeplaying.sql sql/schools.sql sql/people.sql sql/salaries.sql sql/batting.sql sql/pitching.sql sql/fielding.sql sql/appearances.sql sql/homegames.sql sql/seriespost.sql sql/fieldingofsplit.sql sql/teams.sql sql/leagues.sql sql/managers.sql sql/awardsmanagers.sql sql/battingpost.sql sql/fieldingpost.sql sql/pitchingpost.sql sql/appearancespost.sql sql/awardsshareplayers.sql sql/yearlyawards.sql sql/halloffame.sql sql/awardsplayers.sql sql/parkaliases.sql sql/teamseasonshalf.sql sql/managershalf.sql sql/allstarstartingpos.sql sql/allstars.sql sql/allstargames.sql sql/playerstints.sql
rm -f lahman.db
cat sql/allstargames.sql | sqlite3 lahman.db
cat sql/allstars.sql | sqlite3 lahman.db
cat sql/allstarstartingpos.sql | sqlite3 lahman.db
cat sql/appearancespost.sql | sqlite3 lahman.db
cat sql/appearances.sql | sqlite3 lahman.db
cat sql/awardsmanagers.sql | sqlite3 lahman.db
cat sql/awardsplayers.sql | sqlite3 lahman.db
cat sql/awardssharemanagers.sql | sqlite3 lahman.db
cat sql/awardsshareplayers.sql | sqlite3 lahman.db
cat sql/awards.sql | sqlite3 lahman.db
cat sql/battingpost.sql | sqlite3 lahman.db
cat sql/batting.sql | sqlite3 lahman.db
cat sql/collegeplaying.sql | sqlite3 lahman.db
cat sql/fieldingofsplit.sql | sqlite3 lahman.db
cat sql/fieldingof.sql | sqlite3 lahman.db
cat sql/fieldingpost.sql | sqlite3 lahman.db
cat sql/fielding.sql | sqlite3 lahman.db
cat sql/franchises.sql | sqlite3 lahman.db
cat sql/halloffame.sql | sqlite3 lahman.db
cat sql/homegames.sql | sqlite3 lahman.db
cat sql/leagues.sql | sqlite3 lahman.db
cat sql/managershalf.sql | sqlite3 lahman.db
cat sql/managers.sql | sqlite3 lahman.db
cat sql/parkaliases.sql | sqlite3 lahman.db
cat sql/parks.sql | sqlite3 lahman.db
cat sql/people.sql | sqlite3 lahman.db
cat sql/pitchingpost.sql | sqlite3 lahman.db
cat sql/pitching.sql | sqlite3 lahman.db
cat sql/playerstints.sql | sqlite3 lahman.db
cat sql/salaries.sql | sqlite3 lahman.db
cat sql/schools.sql | sqlite3 lahman.db
cat sql/seasons.sql | sqlite3 lahman.db
cat sql/seriespost.sql | sqlite3 lahman.db
cat sql/teamseasonshalf.sql | sqlite3 lahman.db
cat sql/teamseasons.sql | sqlite3 lahman.db
cat sql/teams.sql | sqlite3 lahman.db
cat sql/yearlyawards.sql | sqlite3 lahman.db
sqlite3 lahman.db "VACUUM"
2024-01-27 22:42:08 +00:00
2024-05-05 03:11:20 +00:00
lahman-raw.db:
rm -f lahman-raw.db
2024-05-05 03:14:53 +00:00
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/AllstarFull.csv allstarfull"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Appearances.csv appearances"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Batting.csv batting"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/BattingPost.csv battingpost"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Fielding.csv fielding"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/FieldingOF.csv fieldingof"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/FieldingOFsplit.csv fieldingofsplit"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/FieldingPost.csv fieldingpost"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/HomeGames.csv homegames"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Managers.csv managers"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/ManagersHalf.csv managershalf"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Parks.csv parks"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/People.csv people"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Pitching.csv pitching"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/PitchingPost.csv pitchingpost"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/SeriesPost.csv seriespost"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Teams.csv teams"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/TeamsFranchises.csv teamsfranchises"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/TeamsHalf.csv teamshalf"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/AwardsManagers.csv awardsmanagers"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/AwardsPlayers.csv awardsplayers"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/AwardsShareManagers.csv awardssharemanagers"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/AwardsSharePlayers.csv awardsshareplayers"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/CollegePlaying.csv collegeplaying"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/HallOfFame.csv halloffame"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Salaries.csv salaries"
sqlite3 lahman-raw.db ".import --csv $(LAHMANLITE_CSV_DIR)/Schools.csv schools"