Skip to content

Commit

Permalink
added dist target and version macro
Browse files Browse the repository at this point in the history
  • Loading branch information
wwiv committed Jun 15, 2021
1 parent 8388e53 commit 274ec97
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 9 deletions.
23 changes: 23 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/readme.txt
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
38 changes: 31 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)



4 changes: 3 additions & 1 deletion vmtoolsctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 274ec97

Please sign in to comment.