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.

33 lines
1.3 KiB

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