Skip to content

Commit 4439064

Browse files
authored
Merge pull request #18 from mike632t/stable
Added a make file
2 parents c5eb3ca + cbbe8ef commit 4439064

File tree

2 files changed

+87
-1
lines changed

2 files changed

+87
-1
lines changed

makefile

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#
2+
# makefile - NT Virtual CP/M Machine.
3+
#
4+
# License CC0 1.0 Universal
5+
#
6+
# https://stackoverflow.com/questions/1079832/
7+
#
8+
# 08 Feb 25 0.1 - Initial version - MT
9+
# - Added the ability to create debug code using target-
10+
# specific variable values - MT
11+
#
12+
# Usage:
13+
#
14+
# make - Incremental make.
15+
# make all
16+
# make release - Rebuild application using release flags.
17+
# make debug - Rebuild application using debug flags.
18+
# make clean - Deletes object files
19+
# make VERBOSE=1 - Verbose output
20+
# make backup - Backup files
21+
#
22+
23+
PROJECT = gcc-ntvcm
24+
PROGRAM = ntvcm
25+
SOURCES = ntvcm.cxx x80.cxx
26+
FILES = *.cxx *.hxx LICENSE README.md makefile *.md .gitignore #.gitattributes
27+
OBJECTS = $(SOURCES:.cxx=.o)
28+
OUTPUT = $(PROGRAM).out
29+
LANG = LANG_$(shell (echo $$LANG | cut -f 1 -d '_'))
30+
COMMIT != git log -1 HEAD --format=%h 2> /dev/null
31+
BUILD != printf "%04d" $(shell git rev-list --count HEAD 2> /dev/null)
32+
UNAME != uname
33+
CC = g++
34+
35+
LIBS =
36+
LFLAGS = -static
37+
CFLAGS = -ggdb -fno-builtin -I .
38+
39+
ifndef VERBOSE
40+
VERBOSE = 0
41+
endif
42+
43+
ifneq ($(COMMIT),)
44+
CFLAGS += -DCOMMIT_ID='" [Commit Id: $(COMMIT)]"'
45+
endif
46+
47+
ifneq ($(BUILD),)
48+
CFLAGS += -DBUILD='".$(BUILD)"'
49+
endif
50+
51+
all: CFLAGS += -flto -Ofast -D NDEBUG
52+
all: $(PROGRAM) $(OBJECTS)
53+
54+
$(PROGRAM): $(OBJECTS)
55+
ifneq ($(VERBOSE),0)
56+
@echo
57+
@echo $(CC) $(LFLAGS) $(OBJECTS) -o $@ $(LIBS)
58+
@echo
59+
endif
60+
@$(CC) $(LFLAGS) $(OBJECTS) -o $@ $(LIBS)
61+
@ls --color $@
62+
63+
$(OBJECTS) : $(SOURCES)
64+
ifneq ($(VERBOSE),0)
65+
@echo
66+
@echo $(CC) $(CFLAGS) -c $(SOURCES)
67+
endif
68+
@$(CC) $(CFLAGS) -c $(SOURCES)
69+
70+
release: clean
71+
release: all
72+
73+
debug: clean
74+
debug: CFLAGS += -Og -D DEBUG
75+
debug: $(PROGRAM)
76+
77+
clean:
78+
# @rm -f $(PROGRAM) # -v
79+
@rm -f $(OBJECTS) # -v
80+
81+
backup: clean
82+
@echo "$(PROJECT)-`date +'%Y%m%d%H%M'`.tar.gz"; tar -czpf ..\/$(PROJECT)-`date +'%Y%m%d%H%M'`.tar.gz $(FILES)

ntvcm.cxx

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <djl_con.hxx>
4646
#include <djl_cycle.hxx>
4747

48+
#define AUTHOR "David Lee"
4849
#define FILENAME "ntvcm"
4950
#define VERSION "0.1"
5051
#if !defined(BUILD)
@@ -2914,7 +2915,6 @@ void version() // Display version information
29142915
printf( "0%c %c%c%c %s %s\n", __DATE__[5], __DATE__[0], __DATE__[1], __DATE__[2], &__DATE__[7], __TIME__ );
29152916
else
29162917
printf( "%c%c %c%c%c %s %s\n", __DATE__[4], __DATE__[5], __DATE__[0], __DATE__[1], __DATE__[2], &__DATE__[7], __TIME__ );
2917-
exit( 0 );
29182918
} // version
29192919

29202920
void error( char const * perr = 0 )
@@ -3068,7 +3068,11 @@ int main( int argc, char * argv[] )
30683068
char ca = (char)( parg[1] );
30693069

30703070
if ( 'V' == ca )
3071+
{
30713072
version();
3073+
printf("License CC0 1.0 Universal: See <https://creativecommons.org/publicdomain/zero/1.0/>.\n");
3074+
exit(0);
3075+
}
30723076
#if defined( _WIN32 ) // Windows only
30733077
else if ( 'C' == parg[1] ) // MT - moved other wise option would be converted to lower case before it was tested
30743078
force80x24 = true;

0 commit comments

Comments
 (0)