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.5 KiB

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