diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..93e58d2 --- /dev/null +++ b/config.h.in @@ -0,0 +1,23 @@ +/* + * OS/2 Guest Tools for VMWare + * Copyright (C)2021, Rushfan + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + */ +#ifndef INCLUDED_CONFIG_H +#define INCLUDED_CONFIG_H + +#define VMTOOLS_VERSION "@VMTOOLS_VERSION@" + + +#endif diff --git a/docs/readme.txt b/docs/readme.txt index dee0226..4bfce08 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -1,4 +1,4 @@ -OS/2 Guest support for VMWare +OS/2 Guest support for VMWare @VMTOOLS_VERSION@ OS/2 Guest support for VMWare provides the following guest services for OS/2 guests running under VMWare: diff --git a/makefile b/makefile index 81dd9b4..23fe54a 100644 --- a/makefile +++ b/makefile @@ -2,8 +2,9 @@ # Makefile: OS/2 Guest Tools for VMWare # -CC = wcl386 -AS = wasm +VERSION = 1.0 +CC = wcl386 +AS = wasm # debug info and warning level 3 CFLAGS = -d1 -w3 @@ -34,22 +35,45 @@ VMTOOLSCTL_OBJS = log.obj & .asm.obj: $(AS) $(ASFLAGS) $< -all: $(VMTOOLSD_EXE) $(VMTOOLSCTL_EXE) +all: config.h $(VMTOOLSD_EXE) $(VMTOOLSCTL_EXE) -$(VMTOOLSD_EXE): $(VMTOOLSD_OBJS) +.BEFORE +config.h: config.h.in + sed s/@VMTOOLS_VERSION@/$(VERSION)/ $< > $@ + +$(VMTOOLSD_EXE): config.h $(VMTOOLSD_OBJS) wlink system $(SYSTEM_PM) $(LDFLAGS) name $(VMTOOLSD_EXE) & file {$(VMTOOLSD_OBJS)} -$(VMTOOLSCTL_EXE): $(VMTOOLSCTL_OBJS) +$(VMTOOLSCTL_EXE): config.h $(VMTOOLSCTL_OBJS) wlink system $(SYSTEM) $(LDFLAGS) name $(VMTOOLSCTL_EXE) & file {$(VMTOOLSCTL_OBJS)} +DIST_DIR = .\os2-guest-$(VERSION) +DIST_ZIP = os2-guest-$(VERSION).zip +DIST_README = $(DIST_DIR)\readme.txt +README = docs\readme.txt + +$(DIST_DIR): + mkdir $(DIST_DIR) + +$(DIST_README): $(README) + sed s/@VMTOOLS_VERSION@/$(VERSION)/ $< > $@ + +dist: config.h $(VMTOOLSD_EXE) $(VMTOOLSCTL_EXE) $(DIST_DIR) $(DIST_README) .SYMBOLIC + -del $(DIST_DIR)\*.exe + -del $(DIST_DIR)\*.txt + copy $(VMTOOLSCTL_EXE) $(VMTOOLSD_EXE) $(DIST_DIR) + sed s/@VMTOOLS_VERSION@/$(VERSION)/ $(README) > $(DIST_README) + zip -r $(DIST_ZIP) $(DIST_DIR)\* + clean: .SYMBOLIC + -del config.h -del *.obj -del $(VMTOOLSCTL_EXE) -del $(VMTOOLSD_EXE) - - + -rm -fr $(DIST_DIR) + -del $(DIST_ZIP) diff --git a/vmtoolsctl.cpp b/vmtoolsctl.cpp index 9cce667..e06c420 100644 --- a/vmtoolsctl.cpp +++ b/vmtoolsctl.cpp @@ -14,6 +14,7 @@ * either express or implied. See the License for the specific * language governing permissions and limitations under the License. */ +#include "config.h" #include "guest.h" #include "host.h" #include "log.h" @@ -77,7 +78,8 @@ int exit_app() { } int main(int argc, char* argv[]) { - printf("vmtools: OS/2 Guest for VMWare. [https://github.com/wwiv/os2-guest]\r\n\r\n"); + printf("vmtools: OS/2 Guest for VMWare %s; [https://github.com/wwiv/os2-guest]\r\n\r\n", + VMTOOLS_VERSION); // Interactive mode