Forráskód Böngészése

added --version and make release_linux/osx

ncannasse 7 éve
szülő
commit
0cdde0310d
2 módosított fájl, 30 hozzáadás és 12 törlés
  1. 26 12
      Makefile
  2. 4 0
      src/main.c

+ 26 - 12
Makefile

@@ -49,6 +49,7 @@ ifeq ($(OS),Windows_NT)
 
 
 LIBFLAGS += -Wl,--export-all-symbols
 LIBFLAGS += -Wl,--export-all-symbols
 LIBEXT = dll
 LIBEXT = dll
+RELEASE_NAME=win
 
 
 ifeq ($(ARCH),32)
 ifeq ($(ARCH),32)
 CC=i686-pc-cygwin-gcc
 CC=i686-pc-cygwin-gcc
@@ -64,6 +65,7 @@ LIBFLAGS += -L/opt/libjpeg-turbo/lib -L/usr/local/opt/jpeg-turbo/lib -L/usr/loca
 LIBOPENGL = -framework OpenGL
 LIBOPENGL = -framework OpenGL
 LIBOPENAL = -lopenal
 LIBOPENAL = -lopenal
 LIBSSL = -framework Security -framework CoreFoundation
 LIBSSL = -framework Security -framework CoreFoundation
+RELEASE_NAME = osx
 
 
 else
 else
 
 
@@ -79,6 +81,7 @@ LIBFLAGS += -L/opt/libjpeg-turbo/lib64
 endif
 endif
 
 
 LIBOPENAL = -lopenal
 LIBOPENAL = -lopenal
+RELEASE_NAME = linux
 
 
 endif
 endif
 
 
@@ -138,8 +141,13 @@ uv: ${UV} libhl
 mesa:
 mesa:
 	(cd libs/mesa && make)
 	(cd libs/mesa && make)
 
 
-release: release_win release_haxelib
-	
+release: release_version release_$(RELEASE_NAME)
+
+release_version:
+	$(eval HL_VER := `(hl --version)`)
+	rm -rf $(HLIB)_release
+	mkdir $(HLIB)_release
+
 release_haxelib:
 release_haxelib:
 	make HLIB=directx release_haxelib_package
 	make HLIB=directx release_haxelib_package
 	make HLIB=sdl release_haxelib_package
 	make HLIB=sdl release_haxelib_package
@@ -152,22 +160,28 @@ HLPACK=$(HLIB)
 endif
 endif
 	
 	
 release_haxelib_package:
 release_haxelib_package:
-	rm -rf $(HLIB)_release
-	mkdir $(HLIB)_release
 	(cd libs/$(HLIB) && cp -R $(HLPACK) *.h *.c* haxelib.json ../../$(HLIB)_release | true)
 	(cd libs/$(HLIB) && cp -R $(HLPACK) *.h *.c* haxelib.json ../../$(HLIB)_release | true)
 	zip -r $(HLIB).zip $(HLIB)_release
 	zip -r $(HLIB).zip $(HLIB)_release
 	haxelib submit $(HLIB).zip
 	haxelib submit $(HLIB).zip
 	rm -rf $(HLIB)_release	
 	rm -rf $(HLIB)_release	
 	
 	
 release_win:
 release_win:
-	rm -rf hl_release
-	mkdir hl_release
-	(cd ReleaseVS2013 && cp hl.exe libhl.dll *.hdll *.lib ../hl_release)
-	cp c:/windows/syswow64/msvcr120.dll hl_release
-	mkdir hl_release/include
-	cp src/hl.h src/hlc* hl_release/include
-	zip -r hl_release.zip hl_release
-	rm -rf hl_release
+	(cd ReleaseVS2013 && cp hl.exe libhl.dll *.hdll *.lib ../hl-$(HL_VER))
+	cp c:/windows/syswow64/msvcr120.dll hl-$(HL_VER)
+	mkdir hl-$(HL_VER)/include
+	cp src/hl.h src/hlc* hl-$(HL_VER)/include
+	zip -r hl-$(HL_VER).zip hl-$(HL_VER)
+	rm -rf hl-$(HL_VER)
+
+release_linux:
+	cp hl libhl.so *.hdll hl-$(HL_VER)
+	tar -czf hl-$(HL_VER).tgz hl-$(HL_VER)
+	rm -rf hl-$(HL_VER)
+
+release_osx:
+	cp hl libhl.dylib *.hdll hl-$(HL_VER)
+	tar -czf hl-$(HL_VER).tgz hl-$(HL_VER)
+	rm -rf hl-$(HL_VER)
 
 
 .SUFFIXES : .c .o
 .SUFFIXES : .c .o
 
 

+ 4 - 0
src/main.c

@@ -112,6 +112,10 @@ int main(int argc, pchar *argv[]) {
 			debug_wait = true;
 			debug_wait = true;
 			continue;
 			continue;
 		}
 		}
+		if( pcompare(arg,PSTR("--version")) == 0 ) {
+			printf("%d.%d.%d",HL_VERSION>>8,(HL_VERSION>>4)&15,HL_VERSION&15);
+			return 0;
+		}
 		if( *arg == '-' || *arg == '+' ) {
 		if( *arg == '-' || *arg == '+' ) {
 			if( first_boot_arg < 0 ) first_boot_arg = argc + 1;
 			if( first_boot_arg < 0 ) first_boot_arg = argc + 1;
 			// skip value
 			// skip value