GraphQL API and utilities for the rpdata project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.3 KiB

  1. INSTALL_PATH ?= ./build
  2. # Clean up previous builds, vendor directory and generated files
  3. clean:
  4. rm -rf ./vendor ./schema/bindata.go $(INSTALL_PATH)
  5. # Prepare the dev environment
  6. setup:
  7. dep ensure
  8. go generate ./...
  9. go test ./...
  10. # Build the server (enough for a container/minimal install)
  11. build-server: setup
  12. mkdir -p $(INSTALL_PATH)/usr/bin
  13. mkdir -p $(INSTALL_PATH)/etc/aiterp
  14. cp ./config.example.json $(INSTALL_PATH)/etc/aiterp/rpdata.json
  15. go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-graphiql ./cmd/rpdata-graphiql
  16. # Build the tools needed to port data over
  17. build-tools: build-server
  18. go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-lb2charimport ./cmd/rpdata-lb2charimport
  19. go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-lb2logimport ./cmd/rpdata-lb2logimport
  20. go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-wikifileimport ./cmd/rpdata-wikifileimport
  21. go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-ensurechannels ./cmd/rpdata-ensurechannels
  22. go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-as2storyimport ./cmd/rpdata-ensurechannels
  23. # Build all the things
  24. build: build-server build-tools
  25. # Install locally (requires access to /usr/bin, hence no dependency on build)
  26. install:
  27. cp $(INSTALL_PATH)/usr/bin/* /usr/local/bin/