Эх сурвалжийг харах

Fixed Make file build issue

Toby Chui 3 жил өмнө
parent
commit
e781ff44cd
3 өөрчлөгдсөн 37 нэмэгдсэн , 28 устгасан
  1. 1 0
      .gitignore
  2. 35 28
      Makefile
  3. 1 0
      notification.go

+ 1 - 0
.gitignore

@@ -53,6 +53,7 @@ subservice/*
 
 #Binary related
 build/*
+dist/*
 aroz_online.exe
 aroz_online
 arozos.exe

+ 35 - 28
Makefile

@@ -1,10 +1,10 @@
-PLATFORMS := darwin/amd64 darwin/arm64 freebsd/amd64 linux/386 linux/amd64 linux/arm linux/arm64 linux/mipsle windows/386 windows/amd64 windows/arm windows/arm64
-
+# PLATFORMS := darwin/amd64 darwin/arm64 freebsd/amd64 linux/386 linux/amd64 linux/arm linux/arm64 linux/mipsle windows/386 windows/amd64 windows/arm windows/arm64
+PLATFORMS := darwin/amd64 darwin/arm64 linux/amd64 linux/arm linux/arm64 linux/mipsle windows/amd64 windows/arm64
 temp = $(subst /, ,$@)
 os = $(word 1, $(temp))
 arch = $(word 2, $(temp))
 
-all:  web.tar.gz $(PLATFORMS) arozos_file_checksum.sha1
+all:  web.tar.gz $(PLATFORMS) fixwindows arozos_file_checksum.sha1
 
 binary: $(PLATFORMS)
 
@@ -18,44 +18,51 @@ clean:
 
 $(PLATFORMS):
 	@echo "Building $(os)/$(arch)"
-	GOROOT_FINAL=Git/ GOOS=$(os) GOARCH=$(arch) go build -o './automake/arozos_$(os)_$(arch)'  -ldflags "-s -w" -trimpath
+	GOROOT_FINAL=Git/ GOOS=$(os) GOARCH=$(arch) go build -o './dist/arozos_$(os)_$(arch)'  -ldflags "-s -w" -trimpath
+
+fixwindows:
+	-mv ./dist/arozos_windows_amd64 ./dist/arozos_windows_amd64.exe
+	-mv ./dist/arozos_windows_arm64 ./dist/arozos_windows_arm64.exe
 
 web.tar.gz:
-	-mkdir ./automake/
+	
 	@echo "Removing old build resources, if exists"
-	-rm -rf ./automake/web/
-	-rm -rf ./automake/system/
-	-rm -rf ./automake/subservice/
+	-rm -rf ./dist/
+	-mkdir ./dist/
 
 	@echo "Moving subfolders to build folder"
-	-cp -r ./web ./automake/web/
-	# cp -r ./subservice ./automake/subservice/
-	-cp -r ./system ./automake/system/
+	-cp -r ./web ./dist/web/
+	# cp -r ./subservice ./dist/subservice/
+	-cp -r ./system ./dist/system/
 
 	@ echo "Remove sensitive information"
-	-rm ./automake/system/dev.uuid
-	-rm ./automake/system/ao.db
-	-rm ./automake/system/smtp_conf.json
-	-rm ./automake/system/storage.json
-	# -mv ./automake/system/storage.json ./automake/system/storage.json.example
-	-rm -rf ./automake/system/aecron/
-	-rm ./automake/system/cron.json
-	-rm ./automake/system/bridge.json
-	-rm ./automake/system/auth/authlog.db
+	-rm ./dist/system/dev.uuid
+	-rm ./dist/system/ao.db
+	-rm ./dist/system/smtp_conf.json
+	-rm ./dist/system/storage.json
+	# -mv ./dist/system/storage.json ./dist/system/storage.json.example
+	-rm -rf ./dist/system/aecron/
+	-rm ./dist/system/cron.json
+	-rm ./dist/system/bridge.json
+	-rm ./dist/system/auth/authlog.db
 	
+	@ echo "Remove ip2country, todo: Add binary base searching for this function"
+	-rm -rf "./dist/system/ip2country"
 
 	@ echo "Remove modules that should not go into the build folder"
-	-rm -rf "./automake/web/Cyinput"
-	-rm -rf "./automake/web/Label Maker"
-	-rm -rf "./automake/web/Dummy"
+	-rm -rf "./dist/web/Cyinput"
+	-rm -rf "./dist/web/Label Maker"
+	-rm -rf "./dist/web/Dummy"
+	
 
 	@echo "Creating tarball for all required files"
-	-rm web.tar.gz
-	-cd ./automake/ && tar -czf ../web.tar.gz system/ web/
+	-rm ./dist/web.tar.gz
+	-cd ./dist/ && tar -czf ./web.tar.gz system/ web/
 
-	@echo "Clean up the autobuild directory"
-	rm -rf ./automake/
+	@echo "Clearing up unzipped folder structures"
+	-rm -rf "./dist/web"
+	-rm -rf "./dist/system"
 
 arozos_file_checksum.sha1:
 	@echo "Generating the checksum, if sha1sum installed"
-	-sha1sum arozos_*_* web.tar.gz > arozos_file_checksum.sha1
+	-sha1sum ./dist/arozos_*_* web.tar.gz > arozos_file_checksum.sha1

+ 1 - 0
notification.go

@@ -50,6 +50,7 @@ func notificationInit() {
 
 	go func() {
 		time.Sleep(10 * time.Second)
+		return
 		notificationQueue.BroadcastNotification(&notification.NotificationPayload{
 			ID:            strconv.Itoa(int(time.Now().Unix())),
 			Title:         "Email Test",