Merge branch 'NetHack-3.6.2'
This commit is contained in:
@@ -174,39 +174,39 @@
|
||||
#define DICE 430
|
||||
typedef union
|
||||
{
|
||||
long i;
|
||||
char* map;
|
||||
struct {
|
||||
long room;
|
||||
long wall;
|
||||
long door;
|
||||
} corpos;
|
||||
long i;
|
||||
char *map;
|
||||
struct {
|
||||
long area;
|
||||
long x1;
|
||||
long y1;
|
||||
long x2;
|
||||
long y2;
|
||||
long room;
|
||||
long wall;
|
||||
long door;
|
||||
} corpos;
|
||||
struct {
|
||||
long area;
|
||||
long x1;
|
||||
long y1;
|
||||
long x2;
|
||||
long y2;
|
||||
} lregn;
|
||||
struct {
|
||||
long x;
|
||||
long y;
|
||||
long x;
|
||||
long y;
|
||||
} crd;
|
||||
struct {
|
||||
long ter;
|
||||
long lit;
|
||||
long ter;
|
||||
long lit;
|
||||
} terr;
|
||||
struct {
|
||||
long height;
|
||||
long width;
|
||||
long height;
|
||||
long width;
|
||||
} sze;
|
||||
struct {
|
||||
long die;
|
||||
long num;
|
||||
long die;
|
||||
long num;
|
||||
} dice;
|
||||
struct {
|
||||
long cfunc;
|
||||
char *varstr;
|
||||
long cfunc;
|
||||
char *varstr;
|
||||
} meth;
|
||||
} YYSTYPE;
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
@@ -1024,7 +1024,7 @@ int yy_flex_debug = 0;
|
||||
#define YY_MORE_ADJ 0
|
||||
#define YY_RESTORE_YY_MORE_OFFSET
|
||||
char *yytext;
|
||||
/* NetHack 3.6 lev_comp.l $NHDT-Date: 1522193683 2018/03/27 23:34:43 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.28 $ */
|
||||
/* NetHack 3.6 lev_comp.l $NHDT-Date: 1543372935 2018/11/28 02:42:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.29 $ */
|
||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1102,7 +1102,7 @@ long FDECL(corefunc_str_check, (char *, long));
|
||||
extern void VDECL(lc_error, (const char *, ...));
|
||||
extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int));
|
||||
|
||||
extern struct lc_vardefs *variable_definitions;
|
||||
extern struct lc_vardefs *vardefs;
|
||||
|
||||
extern long FDECL(method_defined, (char *, long, long *));
|
||||
|
||||
@@ -3256,7 +3256,7 @@ handle_varstring_check()
|
||||
struct lc_vardefs *vd;
|
||||
|
||||
yylval.map = dupstr(yytext);
|
||||
if ((vd = vardef_defined(variable_definitions, yytext, 1)) != 0) {
|
||||
if ((vd = vardef_defined(vardefs, yytext, 1)) != 0) {
|
||||
long l = vd->var_type;
|
||||
int a = ((l & SPOVAR_ARRAY) == SPOVAR_ARRAY);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define yyerrok (yyerrflag=0)
|
||||
#define YYRECOVERING (yyerrflag!=0)
|
||||
#define YYPREFIX "yy"
|
||||
/* NetHack 3.6 lev_comp.y $NHDT-Date: 1455747019 2016/02/17 22:10:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */
|
||||
/* NetHack 3.6 lev_comp.y $NHDT-Date: 1543372951 2018/11/28 02:42:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.23 $ */
|
||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -126,7 +126,8 @@ int obj_containment = 0;
|
||||
|
||||
int in_container_obj = 0;
|
||||
|
||||
/* integer value is possibly an inconstant value (eg. dice notation or a variable) */
|
||||
/* integer value is possibly an inconstant value (eg. dice notation
|
||||
or a variable) */
|
||||
int is_inconstant_number = 0;
|
||||
|
||||
int in_switch_statement = 0;
|
||||
@@ -139,7 +140,7 @@ int n_switch_case_list = 0;
|
||||
int allow_break_statements = 0;
|
||||
struct lc_breakdef *break_list = NULL;
|
||||
|
||||
extern struct lc_vardefs *variable_definitions;
|
||||
extern struct lc_vardefs *vardefs; /* variable definitions */
|
||||
|
||||
|
||||
struct lc_vardefs *function_tmp_var_defs = NULL;
|
||||
@@ -158,39 +159,39 @@ extern char curr_token[512];
|
||||
|
||||
typedef union
|
||||
{
|
||||
long i;
|
||||
char* map;
|
||||
struct {
|
||||
long room;
|
||||
long wall;
|
||||
long door;
|
||||
} corpos;
|
||||
long i;
|
||||
char *map;
|
||||
struct {
|
||||
long area;
|
||||
long x1;
|
||||
long y1;
|
||||
long x2;
|
||||
long y2;
|
||||
long room;
|
||||
long wall;
|
||||
long door;
|
||||
} corpos;
|
||||
struct {
|
||||
long area;
|
||||
long x1;
|
||||
long y1;
|
||||
long x2;
|
||||
long y2;
|
||||
} lregn;
|
||||
struct {
|
||||
long x;
|
||||
long y;
|
||||
long x;
|
||||
long y;
|
||||
} crd;
|
||||
struct {
|
||||
long ter;
|
||||
long lit;
|
||||
long ter;
|
||||
long lit;
|
||||
} terr;
|
||||
struct {
|
||||
long height;
|
||||
long width;
|
||||
long height;
|
||||
long width;
|
||||
} sze;
|
||||
struct {
|
||||
long die;
|
||||
long num;
|
||||
long die;
|
||||
long num;
|
||||
} dice;
|
||||
struct {
|
||||
long cfunc;
|
||||
char *varstr;
|
||||
long cfunc;
|
||||
char *varstr;
|
||||
} meth;
|
||||
} YYSTYPE;
|
||||
#define CHAR 257
|
||||
@@ -2605,21 +2606,22 @@ case 5:
|
||||
{
|
||||
if (fatal_error > 0) {
|
||||
(void) fprintf(stderr,
|
||||
"%s: %d errors detected for level \"%s\". No output created!\n",
|
||||
"%s: %d errors detected for level \"%s\". No output created!\n",
|
||||
fname, fatal_error, yyvsp[-2].map);
|
||||
fatal_error = 0;
|
||||
got_errors++;
|
||||
} else if (!got_errors) {
|
||||
if (!write_level_file(yyvsp[-2].map, splev)) {
|
||||
lc_error("Can't write output file for '%s'!", yyvsp[-2].map);
|
||||
lc_error("Can't write output file for '%s'!",
|
||||
yyvsp[-2].map);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
Free(yyvsp[-2].map);
|
||||
Free(splev);
|
||||
splev = NULL;
|
||||
vardef_free_all(variable_definitions);
|
||||
variable_definitions = NULL;
|
||||
vardef_free_all(vardefs);
|
||||
vardefs = NULL;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
@@ -2633,10 +2635,11 @@ case 7:
|
||||
start_level_def(&splev, yyvsp[-2].map);
|
||||
if (yyvsp[0].i == -1) {
|
||||
add_opvars(splev, "iiiiiiiio",
|
||||
VA_PASS9(LVLINIT_MAZEGRID,HWALL,0,0,
|
||||
VA_PASS9(LVLINIT_MAZEGRID, HWALL, 0,0,
|
||||
0,0,0,0, SPO_INITLEVEL));
|
||||
} else {
|
||||
long bg = what_map_char((char) yyvsp[0].i);
|
||||
int bg = (int) what_map_char((char) yyvsp[0].i);
|
||||
|
||||
add_opvars(splev, "iiiiiiiio",
|
||||
VA_PASS9(LVLINIT_SOLIDFILL, bg, 0,0,
|
||||
0,0,0,0, SPO_INITLEVEL));
|
||||
@@ -2660,22 +2663,26 @@ case 9:
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
long filling = yyvsp[0].terr.ter;
|
||||
int filling = (int) yyvsp[0].terr.ter;
|
||||
|
||||
if (filling == INVALID_TYPE || filling >= MAX_TYPE)
|
||||
lc_error("INIT_MAP: Invalid fill char type.");
|
||||
add_opvars(splev, "iiiiiiiio",
|
||||
LVLINIT_SOLIDFILL,filling,0,(long)yyvsp[0].terr.lit, 0,0,0,0, SPO_INITLEVEL);
|
||||
VA_PASS9(LVLINIT_SOLIDFILL, filling,
|
||||
0, (int) yyvsp[0].terr.lit,
|
||||
0,0,0,0, SPO_INITLEVEL));
|
||||
max_x_map = COLNO-1;
|
||||
max_y_map = ROWNO;
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
long filling = what_map_char((char) yyvsp[0].i);
|
||||
int filling = (int) what_map_char((char) yyvsp[0].i);
|
||||
|
||||
if (filling == INVALID_TYPE || filling >= MAX_TYPE)
|
||||
lc_error("INIT_MAP: Invalid fill char type.");
|
||||
add_opvars(splev, "iiiiiiiio",
|
||||
VA_PASS9(LVLINIT_MAZEGRID,filling,0,0,
|
||||
add_opvars(splev, "iiiiiiiio",
|
||||
VA_PASS9(LVLINIT_MAZEGRID, filling, 0,0,
|
||||
0,0,0,0, SPO_INITLEVEL));
|
||||
max_x_map = COLNO-1;
|
||||
max_y_map = ROWNO;
|
||||
@@ -2690,13 +2697,14 @@ case 12:
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
long fg = what_map_char((char) yyvsp[-11].i);
|
||||
long bg = what_map_char((char) yyvsp[-9].i);
|
||||
long smoothed = yyvsp[-7].i;
|
||||
long joined = yyvsp[-5].i;
|
||||
long lit = yyvsp[-3].i;
|
||||
long walled = yyvsp[-1].i;
|
||||
long filling = yyvsp[0].i;
|
||||
int fg = (int) what_map_char((char) yyvsp[-11].i),
|
||||
bg = (int) what_map_char((char) yyvsp[-9].i);
|
||||
int smoothed = (int) yyvsp[-7].i,
|
||||
joined = (int) yyvsp[-5].i,
|
||||
lit = (int) yyvsp[-3].i,
|
||||
walled = (int) yyvsp[-1].i,
|
||||
filling = (int) yyvsp[0].i;
|
||||
|
||||
if (fg == INVALID_TYPE || fg >= MAX_TYPE)
|
||||
lc_error("INIT_MAP: Invalid foreground type.");
|
||||
if (bg == INVALID_TYPE || bg >= MAX_TYPE)
|
||||
@@ -2708,8 +2716,8 @@ case 13:
|
||||
lc_error("INIT_MAP: Invalid fill char type.");
|
||||
|
||||
add_opvars(splev, "iiiiiiiio",
|
||||
VA_PASS9(LVLINIT_MINES,filling,walled,lit,
|
||||
joined,smoothed,bg,fg,
|
||||
VA_PASS9(LVLINIT_MINES, filling, walled, lit,
|
||||
joined, smoothed, bg, fg,
|
||||
SPO_INITLEVEL));
|
||||
max_x_map = COLNO-1;
|
||||
max_y_map = ROWNO;
|
||||
@@ -2753,7 +2761,8 @@ case 22:
|
||||
break;
|
||||
case 23:
|
||||
{
|
||||
add_opvars(splev, "io", VA_PASS2(yyvsp[0].i, SPO_LEVEL_FLAGS));
|
||||
add_opvars(splev, "io",
|
||||
VA_PASS2((int) yyvsp[0].i, SPO_LEVEL_FLAGS));
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
@@ -2784,74 +2793,80 @@ break;
|
||||
case 96:
|
||||
{
|
||||
struct lc_vardefs *vd;
|
||||
if ((vd = vardef_defined(variable_definitions, yyvsp[0].map, 1))) {
|
||||
|
||||
if ((vd = vardef_defined(vardefs, yyvsp[0].map, 1))) {
|
||||
if (!(vd->var_type & SPOVAR_ARRAY))
|
||||
lc_error("Trying to shuffle non-array variable '%s'", yyvsp[0].map);
|
||||
} else lc_error("Trying to shuffle undefined variable '%s'", yyvsp[0].map);
|
||||
lc_error("Trying to shuffle non-array variable '%s'",
|
||||
yyvsp[0].map);
|
||||
} else
|
||||
lc_error("Trying to shuffle undefined variable '%s'",
|
||||
yyvsp[0].map);
|
||||
add_opvars(splev, "so", VA_PASS2(yyvsp[0].map, SPO_SHUFFLE_ARRAY));
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
case 97:
|
||||
{
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-2].map, SPOVAR_INT);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_INT);
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-2].map);
|
||||
}
|
||||
break;
|
||||
case 98:
|
||||
{
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_SEL);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_SEL);
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-4].map);
|
||||
}
|
||||
break;
|
||||
case 99:
|
||||
{
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-2].map, SPOVAR_STRING);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_STRING);
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-2].map);
|
||||
}
|
||||
break;
|
||||
case 100:
|
||||
{
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_MAPCHAR);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_MAPCHAR);
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-4].map);
|
||||
}
|
||||
break;
|
||||
case 101:
|
||||
{
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_MONST);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_MONST);
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-4].map);
|
||||
}
|
||||
break;
|
||||
case 102:
|
||||
{
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_OBJ);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_OBJ);
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-4].map);
|
||||
}
|
||||
break;
|
||||
case 103:
|
||||
{
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-2].map, SPOVAR_COORD);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_COORD);
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-2].map);
|
||||
}
|
||||
break;
|
||||
case 104:
|
||||
{
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-2].map, SPOVAR_REGION);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-2].map, SPOVAR_REGION);
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-2].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-2].map);
|
||||
}
|
||||
break;
|
||||
case 105:
|
||||
{
|
||||
long n_items = yyvsp[-1].i;
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_INT|SPOVAR_ARRAY);
|
||||
int n_items = (int) yyvsp[-1].i;
|
||||
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map,
|
||||
SPOVAR_INT | SPOVAR_ARRAY);
|
||||
add_opvars(splev, "iso",
|
||||
VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-4].map);
|
||||
@@ -2859,8 +2874,10 @@ case 105:
|
||||
break;
|
||||
case 106:
|
||||
{
|
||||
long n_items = yyvsp[-1].i;
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_COORD|SPOVAR_ARRAY);
|
||||
int n_items = (int) yyvsp[-1].i;
|
||||
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map,
|
||||
SPOVAR_COORD | SPOVAR_ARRAY);
|
||||
add_opvars(splev, "iso",
|
||||
VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-4].map);
|
||||
@@ -2868,8 +2885,10 @@ case 106:
|
||||
break;
|
||||
case 107:
|
||||
{
|
||||
long n_items = yyvsp[-1].i;
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_REGION|SPOVAR_ARRAY);
|
||||
int n_items = (int) yyvsp[-1].i;
|
||||
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map,
|
||||
SPOVAR_REGION | SPOVAR_ARRAY);
|
||||
add_opvars(splev, "iso",
|
||||
VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-4].map);
|
||||
@@ -2877,8 +2896,10 @@ case 107:
|
||||
break;
|
||||
case 108:
|
||||
{
|
||||
long n_items = yyvsp[-1].i;
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-6].map, SPOVAR_MAPCHAR|SPOVAR_ARRAY);
|
||||
int n_items = (int) yyvsp[-1].i;
|
||||
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-6].map,
|
||||
SPOVAR_MAPCHAR | SPOVAR_ARRAY);
|
||||
add_opvars(splev, "iso",
|
||||
VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-6].map);
|
||||
@@ -2886,8 +2907,10 @@ case 108:
|
||||
break;
|
||||
case 109:
|
||||
{
|
||||
long n_items = yyvsp[-1].i;
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-6].map, SPOVAR_MONST|SPOVAR_ARRAY);
|
||||
int n_items = (int) yyvsp[-1].i;
|
||||
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-6].map,
|
||||
SPOVAR_MONST | SPOVAR_ARRAY);
|
||||
add_opvars(splev, "iso",
|
||||
VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-6].map);
|
||||
@@ -2895,8 +2918,10 @@ case 109:
|
||||
break;
|
||||
case 110:
|
||||
{
|
||||
long n_items = yyvsp[-1].i;
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-6].map, SPOVAR_OBJ|SPOVAR_ARRAY);
|
||||
int n_items = (int) yyvsp[-1].i;
|
||||
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-6].map,
|
||||
SPOVAR_OBJ | SPOVAR_ARRAY);
|
||||
add_opvars(splev, "iso",
|
||||
VA_PASS3(n_items, yyvsp[-6].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-6].map);
|
||||
@@ -2904,8 +2929,10 @@ case 110:
|
||||
break;
|
||||
case 111:
|
||||
{
|
||||
long n_items = yyvsp[-1].i;
|
||||
variable_definitions = add_vardef_type(variable_definitions, yyvsp[-4].map, SPOVAR_STRING|SPOVAR_ARRAY);
|
||||
int n_items = (int) yyvsp[-1].i;
|
||||
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map,
|
||||
SPOVAR_STRING | SPOVAR_ARRAY);
|
||||
add_opvars(splev, "iso",
|
||||
VA_PASS3(n_items, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
Free(yyvsp[-4].map);
|
||||
@@ -3008,8 +3035,8 @@ case 126:
|
||||
splev = &(funcdef->code);
|
||||
Free(yyvsp[-1].map);
|
||||
curr_function = funcdef;
|
||||
function_tmp_var_defs = variable_definitions;
|
||||
variable_definitions = NULL;
|
||||
function_tmp_var_defs = vardefs;
|
||||
vardefs = NULL;
|
||||
}
|
||||
break;
|
||||
case 127:
|
||||
@@ -3023,21 +3050,25 @@ case 128:
|
||||
splev = function_splev_backup;
|
||||
in_function_definition--;
|
||||
curr_function = NULL;
|
||||
vardef_free_all(variable_definitions);
|
||||
variable_definitions = function_tmp_var_defs;
|
||||
vardef_free_all(vardefs);
|
||||
vardefs = function_tmp_var_defs;
|
||||
}
|
||||
break;
|
||||
case 129:
|
||||
{
|
||||
struct lc_funcdefs *tmpfunc;
|
||||
|
||||
tmpfunc = funcdef_defined(function_definitions, yyvsp[-3].map, 1);
|
||||
if (tmpfunc) {
|
||||
long l;
|
||||
long nparams = strlen( yyvsp[-1].map );
|
||||
int l;
|
||||
int nparams = (int) strlen(yyvsp[-1].map);
|
||||
char *fparamstr = funcdef_paramtypes(tmpfunc);
|
||||
|
||||
if (strcmp(yyvsp[-1].map, fparamstr)) {
|
||||
char *tmps = strdup(decode_parm_str(fparamstr));
|
||||
lc_error("Function '%s' requires params '%s', got '%s' instead.", yyvsp[-3].map, tmps, decode_parm_str(yyvsp[-1].map));
|
||||
|
||||
lc_error("Function '%s' requires params '%s', got '%s' instead.",
|
||||
yyvsp[-3].map, tmps, decode_parm_str(yyvsp[-1].map));
|
||||
Free(tmps);
|
||||
}
|
||||
Free(fparamstr);
|
||||
@@ -3045,9 +3076,11 @@ case 129:
|
||||
if (!(tmpfunc->n_called)) {
|
||||
/* we haven't called the function yet, so insert it in the code */
|
||||
struct opvar *jmp = New(struct opvar);
|
||||
|
||||
set_opvar_int(jmp, splev->n_opcodes+1);
|
||||
add_opcode(splev, SPO_PUSH, jmp);
|
||||
add_opcode(splev, SPO_JMP, NULL); /* we must jump past it first, then CALL it, due to RETURN. */
|
||||
/* we must jump past it first, then CALL it, due to RETURN. */
|
||||
add_opcode(splev, SPO_JMP, NULL);
|
||||
|
||||
tmpfunc->addr = splev->n_opcodes;
|
||||
|
||||
@@ -3062,9 +3095,10 @@ case 129:
|
||||
}
|
||||
|
||||
splev_add_from(splev, &(tmpfunc->code));
|
||||
set_opvar_int(jmp, splev->n_opcodes - jmp->vardata.l);
|
||||
set_opvar_int(jmp,
|
||||
splev->n_opcodes - jmp->vardata.l);
|
||||
}
|
||||
l = tmpfunc->addr - splev->n_opcodes - 2;
|
||||
l = (int) (tmpfunc->addr - splev->n_opcodes - 2);
|
||||
add_opvars(splev, "iio",
|
||||
VA_PASS3(nparams, l, SPO_CALL));
|
||||
tmpfunc->n_called++;
|
||||
@@ -3093,7 +3127,7 @@ case 133:
|
||||
{
|
||||
/* val > rn2(100) */
|
||||
add_opvars(splev, "iio",
|
||||
VA_PASS3((long)yyvsp[0].i, 100, SPO_RN2));
|
||||
VA_PASS3((int) yyvsp[0].i, 100, SPO_RN2));
|
||||
yyval.i = SPO_JG;
|
||||
}
|
||||
break;
|
||||
@@ -3117,6 +3151,7 @@ break;
|
||||
case 137:
|
||||
{
|
||||
struct opvar *chkjmp;
|
||||
|
||||
if (in_switch_statement > 0)
|
||||
lc_error("Cannot nest switch-statements.");
|
||||
|
||||
@@ -3181,6 +3216,7 @@ case 141:
|
||||
{
|
||||
if (n_switch_case_list < MAX_SWITCH_CASES) {
|
||||
struct opvar *tmppush = New(struct opvar);
|
||||
|
||||
set_opvar_int(tmppush, splev->n_opcodes);
|
||||
switch_case_value[n_switch_case_list] = yyvsp[-1].i;
|
||||
switch_case_list[n_switch_case_list++] = tmppush;
|
||||
@@ -3229,8 +3265,7 @@ case 148:
|
||||
/* the value of which is already in stack (the 2nd math_expr) */
|
||||
add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT));
|
||||
|
||||
variable_definitions = add_vardef_type(variable_definitions,
|
||||
yyvsp[-4].map, SPOVAR_INT);
|
||||
vardefs = add_vardef_type(vardefs, yyvsp[-4].map, SPOVAR_INT);
|
||||
/* define the for-loop variable. value is in stack (1st math_expr) */
|
||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT));
|
||||
|
||||
@@ -3260,6 +3295,7 @@ case 149:
|
||||
break;
|
||||
case 150:
|
||||
{
|
||||
int l;
|
||||
char buf[256], buf2[256];
|
||||
|
||||
n_forloops--;
|
||||
@@ -3278,10 +3314,9 @@ case 150:
|
||||
VA_PASS3(0, forloop_list[n_forloops].varname,
|
||||
SPO_VAR_INIT));
|
||||
/* jump back if compared values were not equal */
|
||||
add_opvars(splev, "io",
|
||||
VA_PASS2(
|
||||
forloop_list[n_forloops].jmp_point - splev->n_opcodes - 1,
|
||||
SPO_JNE));
|
||||
l = (int) (forloop_list[n_forloops].jmp_point
|
||||
- splev->n_opcodes - 1);
|
||||
add_opvars(splev, "io", VA_PASS2(l, SPO_JNE));
|
||||
Free(forloop_list[n_forloops].varname);
|
||||
break_stmt_end(splev);
|
||||
}
|
||||
@@ -3308,10 +3343,11 @@ case 152:
|
||||
add_opvars(splev, "oio", VA_PASS3(SPO_COPY, 0, SPO_CMP));
|
||||
|
||||
tmppush = (struct opvar *) if_list[--n_if_list];
|
||||
set_opvar_int(tmppush, tmppush->vardata.l - splev->n_opcodes-1);
|
||||
set_opvar_int(tmppush,
|
||||
tmppush->vardata.l - splev->n_opcodes-1);
|
||||
add_opcode(splev, SPO_PUSH, tmppush);
|
||||
add_opcode(splev, SPO_JG, NULL);
|
||||
add_opcode(splev, SPO_POP, NULL); /* get rid of the count value in stack */
|
||||
add_opcode(splev, SPO_POP, NULL); /* discard count */
|
||||
break_stmt_end(splev);
|
||||
}
|
||||
break;
|
||||
@@ -3340,8 +3376,10 @@ case 154:
|
||||
{
|
||||
if (n_if_list > 0) {
|
||||
struct opvar *tmppush;
|
||||
|
||||
tmppush = (struct opvar *) if_list[--n_if_list];
|
||||
set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l);
|
||||
set_opvar_int(tmppush,
|
||||
splev->n_opcodes - tmppush->vardata.l);
|
||||
} else lc_error("IF: Huh?! No start address?");
|
||||
}
|
||||
break;
|
||||
@@ -3375,8 +3413,10 @@ case 157:
|
||||
{
|
||||
if (n_if_list > 0) {
|
||||
struct opvar *tmppush;
|
||||
|
||||
tmppush = (struct opvar *) if_list[--n_if_list];
|
||||
set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l);
|
||||
set_opvar_int(tmppush,
|
||||
splev->n_opcodes - tmppush->vardata.l);
|
||||
} else lc_error("IF: Huh?! No start address?");
|
||||
}
|
||||
break;
|
||||
@@ -3393,7 +3433,8 @@ case 158:
|
||||
|
||||
tmppush2 = (struct opvar *) if_list[--n_if_list];
|
||||
|
||||
set_opvar_int(tmppush2, splev->n_opcodes - tmppush2->vardata.l);
|
||||
set_opvar_int(tmppush2,
|
||||
splev->n_opcodes - tmppush2->vardata.l);
|
||||
if_list[n_if_list++] = tmppush;
|
||||
} else lc_error("IF: Huh?! No else-part address?");
|
||||
}
|
||||
@@ -3592,7 +3633,7 @@ break;
|
||||
case 192:
|
||||
{
|
||||
add_opvars(splev, "ciisiio",
|
||||
VA_PASS7(0, 0, 1, (char *)0, 0, 0, SPO_MAP));
|
||||
VA_PASS7(0, 0, 1, (char *) 0, 0, 0, SPO_MAP));
|
||||
max_x_map = COLNO-1;
|
||||
max_y_map = ROWNO;
|
||||
}
|
||||
@@ -3600,15 +3641,15 @@ break;
|
||||
case 193:
|
||||
{
|
||||
add_opvars(splev, "cii",
|
||||
VA_PASS3(SP_COORD_PACK((yyvsp[-4].i),(yyvsp[-2].i)),
|
||||
1, (long)yyvsp[-1].i));
|
||||
VA_PASS3(SP_COORD_PACK((yyvsp[-4].i), (yyvsp[-2].i)),
|
||||
1, (int) yyvsp[-1].i));
|
||||
scan_map(yyvsp[0].map, splev);
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
case 194:
|
||||
{
|
||||
add_opvars(splev, "ii", VA_PASS2(2, (long)yyvsp[-1].i));
|
||||
add_opvars(splev, "ii", VA_PASS2(2, (int) yyvsp[-1].i));
|
||||
scan_map(yyvsp[0].map, splev);
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
@@ -3640,6 +3681,7 @@ break;
|
||||
case 203:
|
||||
{
|
||||
struct opvar *stopit = New(struct opvar);
|
||||
|
||||
set_opvar_int(stopit, SP_M_V_END);
|
||||
add_opcode(splev, SPO_PUSH, stopit);
|
||||
yyval.i = 0x0000;
|
||||
@@ -3661,28 +3703,28 @@ break;
|
||||
case 206:
|
||||
{
|
||||
add_opvars(splev, "ii",
|
||||
VA_PASS2((long)yyvsp[0].i, SP_M_V_PEACEFUL));
|
||||
VA_PASS2((int) yyvsp[0].i, SP_M_V_PEACEFUL));
|
||||
yyval.i = 0x0002;
|
||||
}
|
||||
break;
|
||||
case 207:
|
||||
{
|
||||
add_opvars(splev, "ii",
|
||||
VA_PASS2((long)yyvsp[0].i, SP_M_V_ASLEEP));
|
||||
VA_PASS2((int) yyvsp[0].i, SP_M_V_ASLEEP));
|
||||
yyval.i = 0x0004;
|
||||
}
|
||||
break;
|
||||
case 208:
|
||||
{
|
||||
add_opvars(splev, "ii",
|
||||
VA_PASS2((long)yyvsp[0].i, SP_M_V_ALIGN));
|
||||
VA_PASS2((int) yyvsp[0].i, SP_M_V_ALIGN));
|
||||
yyval.i = 0x0008;
|
||||
}
|
||||
break;
|
||||
case 209:
|
||||
{
|
||||
add_opvars(splev, "ii",
|
||||
VA_PASS2((long)yyvsp[-1].i, SP_M_V_APPEAR));
|
||||
VA_PASS2((int) yyvsp[-1].i, SP_M_V_APPEAR));
|
||||
yyval.i = 0x0010;
|
||||
}
|
||||
break;
|
||||
@@ -3749,13 +3791,14 @@ break;
|
||||
case 220:
|
||||
{
|
||||
add_opvars(splev, "ii",
|
||||
VA_PASS2((long)yyvsp[0].i, SP_M_V_SEENTRAPS));
|
||||
VA_PASS2((int) yyvsp[0].i, SP_M_V_SEENTRAPS));
|
||||
yyval.i = 0x8000;
|
||||
}
|
||||
break;
|
||||
case 221:
|
||||
{
|
||||
int token = get_trap_type(yyvsp[0].map);
|
||||
|
||||
if (token == ERR || token == 0)
|
||||
lc_error("Unknown trap type '%s'!", yyvsp[0].map);
|
||||
Free(yyvsp[0].map);
|
||||
@@ -3781,15 +3824,19 @@ case 223:
|
||||
break;
|
||||
case 224:
|
||||
{
|
||||
long cnt = 0;
|
||||
if (in_container_obj) cnt |= SP_OBJ_CONTENT;
|
||||
int cnt = 0;
|
||||
|
||||
if (in_container_obj)
|
||||
cnt |= SP_OBJ_CONTENT;
|
||||
add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT));
|
||||
}
|
||||
break;
|
||||
case 225:
|
||||
{
|
||||
long cnt = SP_OBJ_CONTAINER;
|
||||
if (in_container_obj) cnt |= SP_OBJ_CONTENT;
|
||||
int cnt = SP_OBJ_CONTAINER;
|
||||
|
||||
if (in_container_obj)
|
||||
cnt |= SP_OBJ_CONTENT;
|
||||
add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT));
|
||||
in_container_obj++;
|
||||
break_stmt_start();
|
||||
@@ -3828,7 +3875,7 @@ break;
|
||||
case 230:
|
||||
{
|
||||
add_opvars(splev, "ii",
|
||||
VA_PASS2((long)yyvsp[0].i, SP_O_V_CURSE));
|
||||
VA_PASS2((int) yyvsp[0].i, SP_O_V_CURSE));
|
||||
yyval.i = 0x0001;
|
||||
}
|
||||
break;
|
||||
@@ -3864,7 +3911,7 @@ case 235:
|
||||
break;
|
||||
case 236:
|
||||
{
|
||||
add_opvars(splev, "ii", VA_PASS2((long)yyvsp[0].i, SP_O_V_LIT));
|
||||
add_opvars(splev, "ii", VA_PASS2((int) yyvsp[0].i, SP_O_V_LIT));
|
||||
yyval.i = 0x0040;
|
||||
}
|
||||
break;
|
||||
@@ -3894,7 +3941,8 @@ case 239:
|
||||
break;
|
||||
case 240:
|
||||
{
|
||||
add_opvars(splev, "ii", VA_PASS2(yyvsp[0].i, SP_O_V_TRAPPED));
|
||||
add_opvars(splev, "ii",
|
||||
VA_PASS2((int) 1, SP_O_V_TRAPPED));
|
||||
yyval.i = 0x0400;
|
||||
}
|
||||
break;
|
||||
@@ -3924,7 +3972,7 @@ case 244:
|
||||
break;
|
||||
case 245:
|
||||
{
|
||||
add_opvars(splev, "io", VA_PASS2((long)yyvsp[-2].i, SPO_TRAP));
|
||||
add_opvars(splev, "io", VA_PASS2((int) yyvsp[-2].i, SPO_TRAP));
|
||||
}
|
||||
break;
|
||||
case 246:
|
||||
@@ -3958,14 +4006,14 @@ break;
|
||||
case 247:
|
||||
{
|
||||
add_opvars(splev, "iiio",
|
||||
VA_PASS4((long)yyvsp[0].i, 1, 0, SPO_MAZEWALK));
|
||||
VA_PASS4((int) yyvsp[0].i, 1, 0, SPO_MAZEWALK));
|
||||
}
|
||||
break;
|
||||
case 248:
|
||||
{
|
||||
add_opvars(splev, "iiio",
|
||||
VA_PASS4((long)yyvsp[-3].i, (long)yyvsp[-1].i,
|
||||
(long)yyvsp[0].i, SPO_MAZEWALK));
|
||||
VA_PASS4((int) yyvsp[-3].i, (int) yyvsp[-1].i,
|
||||
(int) yyvsp[0].i, SPO_MAZEWALK));
|
||||
}
|
||||
break;
|
||||
case 249:
|
||||
@@ -3983,13 +4031,13 @@ break;
|
||||
case 251:
|
||||
{
|
||||
add_opvars(splev, "io",
|
||||
VA_PASS2((long)yyvsp[0].i, SPO_LADDER));
|
||||
VA_PASS2((int) yyvsp[0].i, SPO_LADDER));
|
||||
}
|
||||
break;
|
||||
case 252:
|
||||
{
|
||||
add_opvars(splev, "io",
|
||||
VA_PASS2((long)yyvsp[0].i, SPO_STAIR));
|
||||
VA_PASS2((int) yyvsp[0].i, SPO_STAIR));
|
||||
}
|
||||
break;
|
||||
case 253:
|
||||
@@ -4251,16 +4299,17 @@ case 304:
|
||||
break;
|
||||
case 305:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_STRING);
|
||||
vardef_used(variable_definitions, yyvsp[0].map);
|
||||
check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_STRING);
|
||||
vardef_used(vardefs, yyvsp[0].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[0].map));
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
case 306:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_STRING|SPOVAR_ARRAY);
|
||||
vardef_used(variable_definitions, yyvsp[-3].map);
|
||||
check_vardef_type(vardefs, yyvsp[-3].map,
|
||||
SPOVAR_STRING | SPOVAR_ARRAY);
|
||||
vardef_used(vardefs, yyvsp[-3].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map));
|
||||
Free(yyvsp[-3].map);
|
||||
}
|
||||
@@ -4282,16 +4331,17 @@ case 309:
|
||||
break;
|
||||
case 310:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_COORD);
|
||||
vardef_used(variable_definitions, yyvsp[0].map);
|
||||
check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_COORD);
|
||||
vardef_used(vardefs, yyvsp[0].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[0].map));
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
case 311:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_COORD|SPOVAR_ARRAY);
|
||||
vardef_used(variable_definitions, yyvsp[-3].map);
|
||||
check_vardef_type(vardefs, yyvsp[-3].map,
|
||||
SPOVAR_COORD | SPOVAR_ARRAY);
|
||||
vardef_used(vardefs, yyvsp[-3].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map));
|
||||
Free(yyvsp[-3].map);
|
||||
}
|
||||
@@ -4299,7 +4349,8 @@ break;
|
||||
case 312:
|
||||
{
|
||||
if (yyvsp[-3].i < 0 || yyvsp[-1].i < 0 || yyvsp[-3].i >= COLNO || yyvsp[-1].i >= ROWNO)
|
||||
lc_error("Coordinates (%li,%li) out of map range!", yyvsp[-3].i, yyvsp[-1].i);
|
||||
lc_error("Coordinates (%li,%li) out of map range!",
|
||||
yyvsp[-3].i, yyvsp[-1].i);
|
||||
yyval.i = SP_COORD_PACK(yyvsp[-3].i, yyvsp[-1].i);
|
||||
}
|
||||
break;
|
||||
@@ -4310,7 +4361,7 @@ case 313:
|
||||
break;
|
||||
case 314:
|
||||
{
|
||||
yyval.i = SP_COORD_PACK_RANDOM( yyvsp[-1].i );
|
||||
yyval.i = SP_COORD_PACK_RANDOM(yyvsp[-1].i);
|
||||
}
|
||||
break;
|
||||
case 315:
|
||||
@@ -4332,16 +4383,17 @@ case 317:
|
||||
break;
|
||||
case 318:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_REGION);
|
||||
vardef_used(variable_definitions, yyvsp[0].map);
|
||||
check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_REGION);
|
||||
vardef_used(vardefs, yyvsp[0].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[0].map));
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
case 319:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_REGION|SPOVAR_ARRAY);
|
||||
vardef_used(variable_definitions, yyvsp[-3].map);
|
||||
check_vardef_type(vardefs, yyvsp[-3].map,
|
||||
SPOVAR_REGION | SPOVAR_ARRAY);
|
||||
vardef_used(vardefs, yyvsp[-3].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map));
|
||||
Free(yyvsp[-3].map);
|
||||
}
|
||||
@@ -4349,8 +4401,10 @@ break;
|
||||
case 320:
|
||||
{
|
||||
long r = SP_REGION_PACK(yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||
if ( yyvsp[-7].i > yyvsp[-3].i || yyvsp[-5].i > yyvsp[-1].i )
|
||||
lc_error("Region start > end: (%li,%li,%li,%li)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||
|
||||
if (yyvsp[-7].i > yyvsp[-3].i || yyvsp[-5].i > yyvsp[-1].i)
|
||||
lc_error("Region start > end: (%ld,%ld,%ld,%ld)!",
|
||||
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||
|
||||
add_opvars(splev, "r", VA_PASS1(r));
|
||||
yyval.i = r;
|
||||
@@ -4363,16 +4417,17 @@ case 321:
|
||||
break;
|
||||
case 322:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_MAPCHAR);
|
||||
vardef_used(variable_definitions, yyvsp[0].map);
|
||||
check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_MAPCHAR);
|
||||
vardef_used(vardefs, yyvsp[0].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[0].map));
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
case 323:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_MAPCHAR|SPOVAR_ARRAY);
|
||||
vardef_used(variable_definitions, yyvsp[-3].map);
|
||||
check_vardef_type(vardefs, yyvsp[-3].map,
|
||||
SPOVAR_MAPCHAR | SPOVAR_ARRAY);
|
||||
vardef_used(vardefs, yyvsp[-3].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map));
|
||||
Free(yyvsp[-3].map);
|
||||
}
|
||||
@@ -4404,16 +4459,17 @@ case 326:
|
||||
break;
|
||||
case 327:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_MONST);
|
||||
vardef_used(variable_definitions, yyvsp[0].map);
|
||||
check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_MONST);
|
||||
vardef_used(vardefs, yyvsp[0].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[0].map));
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
case 328:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_MONST|SPOVAR_ARRAY);
|
||||
vardef_used(variable_definitions, yyvsp[-3].map);
|
||||
check_vardef_type(vardefs, yyvsp[-3].map,
|
||||
SPOVAR_MONST | SPOVAR_ARRAY);
|
||||
vardef_used(vardefs, yyvsp[-3].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map));
|
||||
Free(yyvsp[-3].map);
|
||||
}
|
||||
@@ -4463,16 +4519,17 @@ case 333:
|
||||
break;
|
||||
case 334:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_OBJ);
|
||||
vardef_used(variable_definitions, yyvsp[0].map);
|
||||
check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_OBJ);
|
||||
vardef_used(vardefs, yyvsp[0].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[0].map));
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
case 335:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[-3].map, SPOVAR_OBJ|SPOVAR_ARRAY);
|
||||
vardef_used(variable_definitions, yyvsp[-3].map);
|
||||
check_vardef_type(vardefs, yyvsp[-3].map,
|
||||
SPOVAR_OBJ | SPOVAR_ARRAY);
|
||||
vardef_used(vardefs, yyvsp[-3].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map));
|
||||
Free(yyvsp[-3].map);
|
||||
}
|
||||
@@ -4484,7 +4541,8 @@ case 336:
|
||||
lc_error("Unknown object \"%s\"!", yyvsp[0].map);
|
||||
yyval.i = -1;
|
||||
} else
|
||||
yyval.i = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */
|
||||
/* obj class != 0 to force generation of a specific item */
|
||||
yyval.i = SP_OBJ_PACK(m, 1);
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
break;
|
||||
@@ -4539,8 +4597,8 @@ case 344:
|
||||
break;
|
||||
case 345:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_INT);
|
||||
vardef_used(variable_definitions, yyvsp[0].map);
|
||||
check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_INT);
|
||||
vardef_used(vardefs, yyvsp[0].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[0].map));
|
||||
Free(yyvsp[0].map);
|
||||
is_inconstant_number = 1;
|
||||
@@ -4548,9 +4606,9 @@ case 345:
|
||||
break;
|
||||
case 346:
|
||||
{
|
||||
check_vardef_type(variable_definitions,
|
||||
yyvsp[-3].map, SPOVAR_INT|SPOVAR_ARRAY);
|
||||
vardef_used(variable_definitions, yyvsp[-3].map);
|
||||
check_vardef_type(vardefs, yyvsp[-3].map,
|
||||
SPOVAR_INT | SPOVAR_ARRAY);
|
||||
vardef_used(vardefs, yyvsp[-3].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[-3].map));
|
||||
Free(yyvsp[-3].map);
|
||||
is_inconstant_number = 1;
|
||||
@@ -4627,9 +4685,7 @@ case 355:
|
||||
lc_error("Unknown func param conversion.");
|
||||
break;
|
||||
}
|
||||
variable_definitions = add_vardef_type(
|
||||
variable_definitions,
|
||||
yyvsp[-2].map, vt);
|
||||
vardefs = add_vardef_type( vardefs, yyvsp[-2].map, vt);
|
||||
}
|
||||
Free(yyvsp[-2].map);
|
||||
}
|
||||
@@ -4767,8 +4823,8 @@ case 382:
|
||||
break;
|
||||
case 383:
|
||||
{
|
||||
check_vardef_type(variable_definitions, yyvsp[0].map, SPOVAR_SEL);
|
||||
vardef_used(variable_definitions, yyvsp[0].map);
|
||||
check_vardef_type(vardefs, yyvsp[0].map, SPOVAR_SEL);
|
||||
vardef_used(vardefs, yyvsp[0].map);
|
||||
add_opvars(splev, "v", VA_PASS1(yyvsp[0].map));
|
||||
Free(yyvsp[0].map);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# NetHack Makefile.
|
||||
# NetHack 3.6 Makefile.src $NHDT-Date: 1539968067 2018/10/19 16:54:27 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.58 $
|
||||
# NetHack 3.6 Makefile.src $NHDT-Date: 1543447374 2018/11/28 23:22:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.60 $
|
||||
# Copyright (c) 2018 by Pasi Kallinen
|
||||
# NetHack may be freely redistributed. See license for details.
|
||||
|
||||
@@ -462,7 +462,7 @@ SYSCXXSRC = ../sys/share/cppregex.cpp
|
||||
GENCSRC = vis_tab.c #tile.c
|
||||
|
||||
# all windowing-system-dependent .c (for dependencies and such)
|
||||
WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
|
||||
WINCSRC = $(WINTTYSRC) $(WINCURSESSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
|
||||
# all windowing-system-dependent .cpp (for dependencies and such)
|
||||
WINCXXSRC = $(WINQTSRC) $(WINQT4SRC) $(WINBESRC)
|
||||
|
||||
@@ -775,36 +775,38 @@ topl.o: ../win/tty/topl.c $(HACK_H) ../include/tcap.h
|
||||
$(CC) $(CFLAGS) -c ../win/tty/topl.c
|
||||
wintty.o: ../win/tty/wintty.c $(HACK_H) ../include/dlb.h ../include/tcap.h
|
||||
$(CC) $(CFLAGS) -c ../win/tty/wintty.c
|
||||
cursmain.o: ../win/curses/cursmain.c $(HACK_H) ../include/wincurs.h
|
||||
cursmain.o: ../win/curses/cursmain.c $(HACK_H) ../include/patchlevel.h \
|
||||
../include/wincurs.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/cursmain.c
|
||||
curswins.o: ../win/curses/curswins.c $(HACK_H) ../include/func_tab.h \
|
||||
../include/wincurs.h ../win/curses/curswins.h
|
||||
curswins.o: ../win/curses/curswins.c $(HACK_H) ../include/wincurs.h \
|
||||
../win/curses/curswins.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/curswins.c
|
||||
cursmisc.o: ../win/curses/cursmisc.c $(HACK_H) ../include/wincurs.h \
|
||||
../win/curses/cursmisc.h
|
||||
../win/curses/cursmisc.h ../include/func_tab.h ../include/dlb.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/cursmisc.c
|
||||
cursdial.o: ../win/curses/cursdial.c $(HACK_H) ../include/func_tab.h \
|
||||
../include/wincurs.h ../win/curses/cursdial.h
|
||||
cursdial.o: ../win/curses/cursdial.c $(HACK_H) ../include/wincurs.h \
|
||||
../win/curses/cursdial.h ../include/func_tab.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/cursdial.c
|
||||
cursstat.o: ../win/curses/cursstat.c $(HACK_H) ../include/wincurs.h \
|
||||
../win/curses/cursstat.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/cursstat.c
|
||||
cursinit.o: ../win/curses/cursinit.c $(HACK_H) ../include/wincurs.h \
|
||||
../win/curses/cursinit.h
|
||||
../win/curses/cursinit.h ../include/patchlevel.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/cursinit.c
|
||||
cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) ../include/wincurs.h \
|
||||
../win/curses/cursinvt.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/cursinvt.c
|
||||
cursmesg.o: ../win/curses/cursmesg.c $(HACK_H) ../include/wincurs.h \
|
||||
../win/curses/cursmesg.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/cursmesg.c
|
||||
cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) ../include/wincurs.h \
|
||||
../win/curses/cursinvt.h
|
||||
$(CC) $(CFLAGS) -c ../win/curses/cursinvt.c
|
||||
Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \
|
||||
$(CONFIG_H) ../include/lint.h
|
||||
$(CC) $(CFLAGS) -c ../win/X11/Window.c
|
||||
dialogs.o: ../win/X11/dialogs.c $(CONFIG_H) ../include/lint.h
|
||||
$(CC) $(CFLAGS) -c ../win/X11/dialogs.c
|
||||
winX.o: ../win/X11/winX.c $(HACK_H) ../include/winX.h ../include/dlb.h \
|
||||
../win/X11/nh72icon ../win/X11/nh56icon ../win/X11/nh32icon
|
||||
../include/xwindow.h ../win/X11/nh72icon ../win/X11/nh56icon \
|
||||
../win/X11/nh32icon
|
||||
$(CC) $(CFLAGS) -c ../win/X11/winX.c
|
||||
winmap.o: ../win/X11/winmap.c ../include/xwindow.h $(HACK_H) ../include/dlb.h \
|
||||
../include/winX.h ../include/tile2x11.h
|
||||
@@ -816,7 +818,7 @@ winmesg.o: ../win/X11/winmesg.c ../include/xwindow.h $(HACK_H) ../include/winX.h
|
||||
winmisc.o: ../win/X11/winmisc.c $(HACK_H) ../include/func_tab.h \
|
||||
../include/winX.h
|
||||
$(CC) $(CFLAGS) -c ../win/X11/winmisc.c
|
||||
winstat.o: ../win/X11/winstat.c $(HACK_H) ../include/winX.h
|
||||
winstat.o: ../win/X11/winstat.c $(HACK_H) ../include/winX.h ../include/xwindow.h
|
||||
$(CC) $(CFLAGS) -c ../win/X11/winstat.c
|
||||
wintext.o: ../win/X11/wintext.c $(HACK_H) ../include/winX.h ../include/xwindow.h
|
||||
$(CC) $(CFLAGS) -c ../win/X11/wintext.c
|
||||
@@ -887,51 +889,82 @@ qt_clust.o: ../win/Qt/qt_clust.cpp ../include/qt_clust.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt/qt_clust.cpp
|
||||
qttableview.o: ../win/Qt/qttableview.cpp ../include/qttableview.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt/qttableview.cpp
|
||||
qt4bind.o : ../win/Qt4/qt4bind.cpp $(HACK_H) ../win/Qt4/qt4bind.h
|
||||
qt4bind.o: ../win/Qt4/qt4bind.cpp $(HACK_H) ../win/Qt4/qt4bind.h \
|
||||
../win/Qt4/qt4click.h ../win/Qt4/qt4delay.h \
|
||||
../win/Qt4/qt4xcmd.h ../win/Qt4/qt4key.h ../win/Qt4/qt4map.h \
|
||||
../win/Qt4/qt4menu.h ../win/Qt4/qt4msg.h ../win/Qt4/qt4plsel.h \
|
||||
../win/Qt4/qt4svsel.h ../win/Qt4/qt4set.h ../win/Qt4/qt4stat.h \
|
||||
../win/Qt4/qt4streq.h ../win/Qt4/qt4yndlg.h \
|
||||
../win/Qt4/qt4str.h ../include/dlb.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4bind.cpp
|
||||
qt4click.o : ../win/Qt4/qt4click.cpp $(HACK_H) ../win/Qt4/qt4click.h
|
||||
qt4click.o: ../win/Qt4/qt4click.cpp $(HACK_H) ../win/Qt4/qt4click.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4click.cpp
|
||||
qt4clust.o : ../win/Qt4/qt4clust.cpp $(HACK_H) ../win/Qt4/qt4clust.h
|
||||
qt4clust.o: ../win/Qt4/qt4clust.cpp ../win/Qt4/qt4clust.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4clust.cpp
|
||||
qt4delay.o : ../win/Qt4/qt4delay.cpp $(HACK_H) ../win/Qt4/qt4delay.h
|
||||
qt4delay.o: ../win/Qt4/qt4delay.cpp $(HACK_H) ../win/Qt4/qt4delay.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4delay.cpp
|
||||
qt4glyph.o : ../win/Qt4/qt4glyph.cpp $(HACK_H) ../win/Qt4/qt4glyph.h
|
||||
qt4glyph.o: ../win/Qt4/qt4glyph.cpp $(HACK_H) ../include/tile2x11.h \
|
||||
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4glyph.cpp
|
||||
qt4icon.o : ../win/Qt4/qt4icon.cpp $(HACK_H) ../win/Qt4/qt4icon.h
|
||||
qt4icon.o: ../win/Qt4/qt4icon.cpp $(HACK_H) ../win/Qt4/qt4icon.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4icon.cpp
|
||||
qt4inv.o : ../win/Qt4/qt4inv.cpp $(HACK_H) ../win/Qt4/qt4inv.h
|
||||
qt4inv.o: ../win/Qt4/qt4inv.cpp $(HACK_H) ../win/Qt4/qt4inv.h \
|
||||
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4inv.cpp
|
||||
qt4key.o : ../win/Qt4/qt4key.cpp $(HACK_H) ../win/Qt4/qt4key.h
|
||||
qt4key.o: ../win/Qt4/qt4key.cpp $(HACK_H) ../win/Qt4/qt4key.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4key.cpp
|
||||
qt4line.o : ../win/Qt4/qt4line.cpp $(HACK_H) ../win/Qt4/qt4line.h
|
||||
qt4line.o: ../win/Qt4/qt4line.cpp $(HACK_H) ../win/Qt4/qt4line.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4line.cpp
|
||||
qt4main.o : ../win/Qt4/qt4main.cpp $(HACK_H) qt4main.moc ../win/Qt4/qt4main.h qt4kde0.moc
|
||||
qt4main.o: ../win/Qt4/qt4main.cpp $(HACK_H) ../include/patchlevel.h \
|
||||
../win/Qt4/qt4main.h qt4main.moc ../win/Qt4/qt4bind.h \
|
||||
../win/Qt4/qt4glyph.h ../win/Qt4/qt4inv.h ../win/Qt4/qt4key.h \
|
||||
../win/Qt4/qt4map.h ../win/Qt4/qt4msg.h ../win/Qt4/qt4set.h \
|
||||
../win/Qt4/qt4stat.h ../win/Qt4/qt4str.h qt4kde0.moc
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4main.cpp
|
||||
qt4map.o : ../win/Qt4/qt4map.cpp $(HACK_H) qt4map.moc ../win/Qt4/qt4map.h
|
||||
qt4map.o: ../win/Qt4/qt4map.cpp $(HACK_H) ../win/Qt4/qt4map.h qt4map.moc \
|
||||
../win/Qt4/qt4click.h ../win/Qt4/qt4glyph.h \
|
||||
../include/qt_xpms.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4map.cpp
|
||||
qt4menu.o : ../win/Qt4/qt4menu.cpp $(HACK_H) qt4menu.moc ../win/Qt4/qt4menu.h
|
||||
qt4menu.o: ../win/Qt4/qt4menu.cpp $(HACK_H) ../win/Qt4/qt4menu.h qt4menu.moc \
|
||||
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h \
|
||||
../win/Qt4/qt4streq.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4menu.cpp
|
||||
qt4msg.o : ../win/Qt4/qt4msg.cpp $(HACK_H) qt4msg.moc ../win/Qt4/qt4msg.h
|
||||
qt4msg.o: ../win/Qt4/qt4msg.cpp $(HACK_H) ../win/Qt4/qt4msg.h qt4msg.moc \
|
||||
../win/Qt4/qt4map.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4msg.cpp
|
||||
qt4plsel.o : ../win/Qt4/qt4plsel.cpp $(HACK_H) qt4plsel.moc ../win/Qt4/qt4plsel.h
|
||||
qt4plsel.o: ../win/Qt4/qt4plsel.cpp $(HACK_H) ../win/Qt4/qt4plsel.h \
|
||||
qt4plsel.moc ../win/Qt4/qt4bind.h ../win/Qt4/qt4glyph.h \
|
||||
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4plsel.cpp
|
||||
qt4rip.o : ../win/Qt4/qt4rip.cpp $(HACK_H) ../win/Qt4/qt4rip.h
|
||||
qt4rip.o: ../win/Qt4/qt4rip.cpp $(HACK_H) ../win/Qt4/qt4rip.h \
|
||||
../win/Qt4/qt4bind.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4rip.cpp
|
||||
qt4set.o : ../win/Qt4/qt4set.cpp $(HACK_H) qt4set.moc ../win/Qt4/qt4set.h
|
||||
qt4set.o: ../win/Qt4/qt4set.cpp $(HACK_H) ../win/Qt4/qt4set.h qt4set.moc \
|
||||
../win/Qt4/qt4glyph.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4set.cpp
|
||||
qt4stat.o : ../win/Qt4/qt4stat.cpp $(HACK_H) qt4stat.moc ../win/Qt4/qt4stat.h
|
||||
qt4stat.o: ../win/Qt4/qt4stat.cpp $(HACK_H) ../win/Qt4/qt4stat.h qt4stat.moc \
|
||||
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h ../include/qt_xpms.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4stat.cpp
|
||||
qt4str.o : ../win/Qt4/qt4str.cpp ../win/Qt4/qt4str.h
|
||||
qt4str.o: ../win/Qt4/qt4str.cpp ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4str.cpp
|
||||
qt4streq.o : ../win/Qt4/qt4streq.cpp $(HACK_H) ../win/Qt4/qt4streq.h
|
||||
qt4streq.o: ../win/Qt4/qt4streq.cpp $(HACK_H) ../win/Qt4/qt4streq.h \
|
||||
../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4streq.cpp
|
||||
qt4svsel.o : ../win/Qt4/qt4svsel.cpp $(HACK_H) ../win/Qt4/qt4svsel.h
|
||||
qt4svsel.o: ../win/Qt4/qt4svsel.cpp $(HACK_H) ../win/Qt4/qt4svsel.h \
|
||||
../win/Qt4/qt4bind.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4svsel.cpp
|
||||
qt4win.o : ../win/Qt4/qt4win.cpp $(HACK_H) ../win/Qt4/qt4win.h
|
||||
qt4win.o: ../win/Qt4/qt4win.cpp $(HACK_H) ../win/Qt4/qt4win.h \
|
||||
../win/Qt4/qt4bind.h ../win/Qt4/qt4click.h \
|
||||
../win/Qt4/qt4glyph.h ../win/Qt4/qt4inv.h ../win/Qt4/qt4key.h \
|
||||
../win/Qt4/qt4icon.h ../win/Qt4/qt4map.h ../win/Qt4/qt4menu.h \
|
||||
../win/Qt4/qt4msg.h ../win/Qt4/qt4set.h ../win/Qt4/qt4clust.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4win.cpp
|
||||
qt4xcmd.o : ../win/Qt4/qt4xcmd.cpp $(HACK_H) qt4xcmd.moc ../win/Qt4/qt4xcmd.h
|
||||
qt4xcmd.o: ../win/Qt4/qt4xcmd.cpp $(HACK_H) ../include/func_tab.h \
|
||||
../win/Qt4/qt4xcmd.h qt4xcmd.moc ../win/Qt4/qt4bind.h \
|
||||
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4xcmd.cpp
|
||||
qt4yndlg.o : ../win/Qt4/qt4yndlg.cpp $(HACK_H) qt4yndlg.moc ../win/Qt4/qt4yndlg.h
|
||||
qt4yndlg.o: ../win/Qt4/qt4yndlg.cpp $(HACK_H) ../win/Qt4/qt4yndlg.h \
|
||||
qt4yndlg.moc ../win/Qt4/qt4str.h
|
||||
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4yndlg.cpp
|
||||
wc_chainin.o: ../win/chain/wc_chainin.c $(HACK_H)
|
||||
$(CC) $(CFLAGS) -c ../win/chain/wc_chainin.c
|
||||
@@ -948,7 +981,7 @@ attrib.o: attrib.c $(HACK_H)
|
||||
ball.o: ball.c $(HACK_H)
|
||||
bones.o: bones.c $(HACK_H) ../include/lev.h
|
||||
botl.o: botl.c $(HACK_H)
|
||||
cmd.o: cmd.c $(HACK_H) ../include/func_tab.h
|
||||
cmd.o: cmd.c $(HACK_H) ../include/lev.h ../include/func_tab.h
|
||||
dbridge.o: dbridge.c $(HACK_H)
|
||||
decl.o: decl.c $(HACK_H)
|
||||
detect.o: detect.c $(HACK_H) ../include/artifact.h
|
||||
|
||||
@@ -291,7 +291,7 @@ clean:
|
||||
|
||||
# 'make spotless' returns the source tree to near-distribution condition.
|
||||
# it removes .o files, executables, and compiled data files
|
||||
spotless:
|
||||
spotless::
|
||||
( cd src ; $(MAKE) spotless )
|
||||
( cd util ; $(MAKE) spotless )
|
||||
( cd dat ; $(MAKE) spotless )
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
// the identifier XCode needs in order to sign your builds.
|
||||
//
|
||||
// Your DEVELOPMENT_TEAM can be found by opening Keychain Access
|
||||
// (found by Finder->Applications->Utilities). Click on "My Certificates".
|
||||
// Look for your "Mac Developer" certificate. Right click on
|
||||
// (found by Finder->Applications->Utilities). Click on "Login" key chain.
|
||||
// Click on catagory "My Certificates".
|
||||
//
|
||||
// Look for your "Mac Developer" certificate. Double click on
|
||||
// the certificate to open a dialog that shows certificate details.
|
||||
// Look for "Organizational Unit" among the details. This ten digit value
|
||||
// is your development team identifier.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# depend.awk -- awk script used to construct makefile dependencies
|
||||
# for nethack's source files (`make depend' support for Makefile.src).
|
||||
# $NHDT-Date: 1524684206 2018/04/25 19:23:26 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.6 $
|
||||
# $NHDT-Date: 1543447376 2018/11/28 23:22:56 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.7 $
|
||||
#
|
||||
# usage:
|
||||
# cd src ; nawk -f depend.awk ../include/*.h list-of-.c/.cpp-files
|
||||
@@ -39,8 +39,16 @@ FNR == 1 { output_dep() #finish previous file
|
||||
/^\#[ \t]*include[ \t]+\"/ { #find `#include "X"'
|
||||
incl = $2
|
||||
#[3.4.0: gnomehack headers currently aren't in include]
|
||||
#[3.6.2: Qt4 headers aren't in include either]
|
||||
#[3.6.2: curses headers likewise]
|
||||
if (incl ~ /\.h$/) {
|
||||
if (incl ~ /^gn/) # gnomehack special case
|
||||
if (incl ~ "curses\.h")
|
||||
incl = "" # skip "curses.h"; it should be <curses.h>
|
||||
else if (incl ~ /^curs/) # curses special case
|
||||
incl = "../win/curses/" incl
|
||||
else if (incl ~ /^qt4/) # Qt v4 special case
|
||||
incl = "../win/Qt4/" incl
|
||||
else if (incl ~ /^gn/) # gnomehack special case
|
||||
incl = "../win/gnome/" incl
|
||||
else
|
||||
incl = "../include/" incl
|
||||
@@ -80,7 +88,7 @@ function output_specials( i, sp, alt_sp)
|
||||
print "#", alt_sp, "timestamp" #output a `make' comment
|
||||
#- sub("\\.", "_", alt_sp); alt_sp = "$(" toupper(alt_sp) ")"
|
||||
#+ Some nawks don't have toupper(), so hardwire these instead.
|
||||
sub("config.h", "$(CONFIG_H)", alt_sp); sub("hack.h", "$(HACK_H)", alt_sp);
|
||||
sub("config.h", "$(CONFIG_H)", alt_sp); sub("hack.h", "$(HACK_H)", alt_sp)
|
||||
format_dep(alt_sp, sp) #output the target
|
||||
print "\ttouch " alt_sp #output a build command
|
||||
alt_deps[sp] = alt_sp #alternate dependency for depend()
|
||||
|
||||
397
sys/unix/hints/macosx10.14
Normal file
397
sys/unix/hints/macosx10.14
Normal file
@@ -0,0 +1,397 @@
|
||||
#
|
||||
# NetHack 3.6 macosx10.11 $NHDT-Date: 1515549543 2018/01/10 01:59:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $
|
||||
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015.
|
||||
# NetHack may be freely redistributed. See license for details.
|
||||
#
|
||||
#-PRE
|
||||
# Mac OS X (Darwin) hints file
|
||||
# This is for Mac OS X 10.10 or later, and has been tested on 10.11
|
||||
# (El Capitan). If this doesn't work for some other
|
||||
# version of Mac OS X, make a new file for that OS, don't change this one.
|
||||
# And let us know about it.
|
||||
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
|
||||
|
||||
# You'll need to obtain and install XQuartz if you want X11 support.
|
||||
# (Attempting to run X11.app will describe where to get it.)
|
||||
|
||||
# This hints file can build several different types of installations.
|
||||
# Edit the next section to match the type of build you need.
|
||||
|
||||
# 1. Which window system(s) should be included in this binary?
|
||||
WANT_WIN_TTY=1
|
||||
#WANT_WIN_X11=1
|
||||
#WANT_WIN_QT=1
|
||||
#WANT_WIN_CURSES=1
|
||||
|
||||
# 1a. What is the default window system?
|
||||
WANT_DEFAULT=tty
|
||||
#WANT_DEFAULT=x11
|
||||
#WANT_DEFAULT=qt
|
||||
#WANT_DEFAULT=curses
|
||||
|
||||
# 1b. If you set WANT_WIN_QT, you need to
|
||||
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
|
||||
# library installation root. (Qt4 will not work; Qt3 does not presently
|
||||
# compile under Leopard (MacOSX 10.5) out-of-the-box.)
|
||||
# B) set XPMLIB to point to the Xpm library
|
||||
ifdef WANT_WIN_QT
|
||||
QTDIR=/Developer/Qt
|
||||
LIBXPM= -L/opt/X11/lib -lXpm
|
||||
endif # WANT_WIN_QT
|
||||
|
||||
# 2. Is this a build for a binary that will be shared among different users
|
||||
# or will it be private to you?
|
||||
# If it is shared:
|
||||
# - it will be owned by the user and group listed
|
||||
# - if the user does not exist, you MUST create it before installing
|
||||
# NetHack
|
||||
# - if the group does not exist, it will be created.
|
||||
# NB: if the group already exists and is being used for something
|
||||
# besides games, you probably want to specify a new group instead
|
||||
# NB: the group will be created locally; if your computer is centrally
|
||||
# administered this may not be what you (or your admin) want.
|
||||
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
|
||||
# - 'make install' must be run as "sudo make install"
|
||||
#WANT_SHARE_INSTALL=1
|
||||
GAMEUID = $(USER)
|
||||
GAMEGRP = games
|
||||
# build to run in the source tree - primarily for development. Build with "make all"
|
||||
#WANT_SOURCE_INSTALL=1
|
||||
|
||||
CC=gcc
|
||||
|
||||
# At the moment this is just for debugging, but in the future it could be
|
||||
# useful for other things. Requires SYSCF and an ANSI compiler.
|
||||
#WANT_WIN_CHAIN=1
|
||||
|
||||
#
|
||||
# You shouldn't need to change anything below here.
|
||||
#
|
||||
|
||||
#CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
|
||||
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic
|
||||
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
|
||||
# leave it out by default.
|
||||
#CFLAGS+=-Wunreachable-code
|
||||
|
||||
# XXX -g vs -O should go here, -I../include goes in the makefile
|
||||
CFLAGS+=-g -I../include
|
||||
# older binaries use NOCLIPPING, but that disables SIGWINCH
|
||||
#CFLAGS+=-DNOCLIPPING
|
||||
CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
|
||||
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
|
||||
|
||||
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
|
||||
|
||||
ifdef WANT_WIN_CHAIN
|
||||
CFLAGS+= -DWINCHAIN
|
||||
HINTSRC=$(CHAINSRC)
|
||||
HINTOBJ=$(CHAINOBJ)
|
||||
endif
|
||||
|
||||
ifdef WANT_WIN_TTY
|
||||
WINSRC = $(WINTTYSRC)
|
||||
WINOBJ = $(WINTTYOBJ)
|
||||
WINLIB = $(WINTTYLIB)
|
||||
WINTTYLIB=-lncurses
|
||||
else # !WANT_WIN_TTY
|
||||
CFLAGS += -DNOTTYGRAPHICS
|
||||
endif # !WANT_WIN_TTY
|
||||
|
||||
ifdef WANT_WIN_CURSES
|
||||
CFLAGS += -DCURSES_GRAPHICS
|
||||
WINSRC += $(WINCURSESSRC)
|
||||
WINOBJ += $(WINCURSESOBJ)
|
||||
WINLIB += -lncurses
|
||||
endif
|
||||
|
||||
ifdef WANT_WIN_X11
|
||||
WINSRC += $(WINX11SRC)
|
||||
WINOBJ += $(WINX11OBJ)
|
||||
WINLIB += $(WINX11LIB)
|
||||
LFLAGS=-L/opt/X11/lib
|
||||
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
|
||||
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir);
|
||||
CFLAGS += -DX11_GRAPHICS -I/opt/X11/include
|
||||
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
|
||||
CFLAGS += -Wno-variadic-macros
|
||||
endif # WANT_WIN_X11
|
||||
|
||||
ifdef WANT_WIN_QT
|
||||
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
|
||||
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
|
||||
LINK=g++
|
||||
WINSRC += $(WINQTSRC)
|
||||
WINLIB += $(WINQTLIB) $(LIBXPM)
|
||||
WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
|
||||
WINLIB += -framework AGL
|
||||
ifdef WANT_WIN_X11
|
||||
# prevent duplicate tile.o in WINOBJ
|
||||
WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
|
||||
ifdef WANT_WIN_TTY
|
||||
WINOBJ += $(WINTTYOBJ)
|
||||
endif # WANT_WIN_TTY
|
||||
else # !WANT_WIN_X11
|
||||
WINOBJ += $(WINQTOBJ)
|
||||
endif # !WANT_WIN_X11
|
||||
|
||||
# XXX if /Developer/qt exists and QTDIR not set, use that
|
||||
ifndef QTDIR
|
||||
$(error QTDIR not defined in the environment or Makefile)
|
||||
endif # QTDIR
|
||||
# XXX make sure QTDIR points to something reasonable
|
||||
else # !WANT_WIN_QT
|
||||
LINK=$(CC)
|
||||
endif # !WANT_WIN_QT
|
||||
|
||||
ifdef WANT_SHARE_INSTALL
|
||||
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
|
||||
# we install into ~/nethackdir
|
||||
ifeq ($(GAMEUID),root)
|
||||
PREFIX:=/Library/NetHack
|
||||
SHELLDIR=/usr/local/bin
|
||||
HACKDIR=$(PREFIX)/nethackdir
|
||||
CHOWN=chown
|
||||
CHGRP=chgrp
|
||||
# We run sgid so the game has access to both HACKDIR and user preferences.
|
||||
GAMEPERM = 02755
|
||||
else # ! root
|
||||
PREFIX:=/Users/$(GAMEUID)
|
||||
SHELLDIR=$(PREFIX)/bin
|
||||
HACKDIR=$(PREFIX)/Library/NetHack/nethackdir
|
||||
CHOWN=/usr/bin/true
|
||||
CHGRP=/usr/bin/true
|
||||
GAMEPERM = 0500
|
||||
endif # ! root
|
||||
VARFILEPERM = 0664
|
||||
VARDIRPERM = 0775
|
||||
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
|
||||
# XXX it's nice we don't write over sysconf, but we've already erased it
|
||||
# make sure we have group GAMEUID and group GAMEGRP
|
||||
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
|
||||
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
|
||||
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
||||
else ifdef WANT_SOURCE_INSTALL
|
||||
PREFIX=$(abspath $(NHSROOT))
|
||||
# suppress nethack.sh
|
||||
#SHELLDIR=
|
||||
HACKDIR=$(PREFIX)/playground
|
||||
CHOWN=/usr/bin/true
|
||||
CHGRP=/usr/bin/true
|
||||
GAMEPERM = 0700
|
||||
VARFILEPERM = 0600
|
||||
VARDIRPERM = 0700
|
||||
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf;
|
||||
# We can use "make all" to build the whole thing - but it misses some things:
|
||||
MOREALL=$(MAKE) install
|
||||
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
||||
else # !WANT_SOURCE_INSTALL
|
||||
PREFIX:=$(wildcard ~)
|
||||
SHELLDIR=$(PREFIX)/bin
|
||||
HACKDIR=$(PREFIX)/nethackdir
|
||||
CHOWN=/usr/bin/true
|
||||
CHGRP=/usr/bin/true
|
||||
GAMEPERM = 0700
|
||||
VARFILEPERM = 0600
|
||||
VARDIRPERM = 0700
|
||||
ifdef WANT_WIN_X11
|
||||
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
|
||||
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc
|
||||
endif # WANT_WIN_X11
|
||||
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
|
||||
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
||||
endif # !WANT_SOURCE_INSTALL
|
||||
|
||||
INSTDIR=$(HACKDIR)
|
||||
VARDIR=$(HACKDIR)
|
||||
|
||||
|
||||
# ~/Library/Preferences/NetHack Defaults
|
||||
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
|
||||
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
|
||||
#
|
||||
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
|
||||
# package under the docs directory).
|
||||
|
||||
#-POST
|
||||
ifdef MAKEFILE_TOP
|
||||
###
|
||||
### Packaging
|
||||
###
|
||||
# Notes:
|
||||
# 1) The Apple developer utilities must be installed in the default location.
|
||||
# 2) Do a normal build before trying to package the game.
|
||||
# 3) This matches the 3.4.3 Term package, but there are some things that should
|
||||
# be changed.
|
||||
#
|
||||
# Packages that are being distributed must be signed by a Developer ID Installer
|
||||
# certificate. Set DEVELOPER_CERT to the name of the certificate if you wish
|
||||
# for your package to be signed for distribution.
|
||||
#
|
||||
# If building a package for signing, you must use sudo approriately.
|
||||
# the binaries and package using sudo but you DO NOT use sudo to sign the
|
||||
# package. If you use sudo to sign the package, it will fail.
|
||||
#
|
||||
# sudo make all
|
||||
# sudo make build_tty_pkg
|
||||
# sudo sign_tty_pkg
|
||||
#
|
||||
|
||||
|
||||
ifdef WANT_WIN_TTY
|
||||
DEVUTIL=/Developer/Applications/Utilities
|
||||
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
|
||||
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
|
||||
|
||||
PKGROOT_UG = PKGROOT/$(PREFIX)
|
||||
PKGROOT_UGLN = PKGROOT/$(HACKDIR)
|
||||
PKGROOT_BIN = PKGROOT/$(SHELLDIR)
|
||||
|
||||
#DEVELOPER_CERT = Developer ID Installer: Bart House
|
||||
DEVELOPER_CERT = NONE
|
||||
|
||||
spotless::
|
||||
rm -rf RESOURCES
|
||||
rm -rf PKG
|
||||
rm -rf PKGSCRIPTS
|
||||
rm -rf PKGROOT
|
||||
rm -f Info.plist
|
||||
rm -f Distribution.xml
|
||||
rm -f NetHack-*-mac-Term*
|
||||
|
||||
build_tty_pkg:
|
||||
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
|
||||
-echo build_tty_pkg only works for a tty-only build
|
||||
exit 1
|
||||
else
|
||||
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
|
||||
$(MAKE) build_package_root
|
||||
rm -rf RESOURCES
|
||||
mkdir RESOURCES
|
||||
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
|
||||
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
|
||||
sys/unix/hints/macosx.sh infoplist > Info.plist
|
||||
|
||||
mkdir PKGROOT/Applications
|
||||
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
|
||||
# win/macosx/NetHackRecover.applescript
|
||||
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
|
||||
osacompile -o PKGROOT/Applications/NetHackRecover.app \
|
||||
win/macosx/NetHackRecover.applescript
|
||||
cp win/macosx/recover.pl $(PKGROOT_UGLN)
|
||||
|
||||
osacompile -o PKGROOT/Applications/NetHackTerm.app \
|
||||
win/macosx/NetHackTerm.applescript
|
||||
|
||||
# XXX integrate into Makefile.doc
|
||||
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
|
||||
| tbl tmac.n - | groff | pstopdf -i -o Guidebook.pdf)
|
||||
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
|
||||
|
||||
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
|
||||
win/macosx/NetHackGuidebook.applescript
|
||||
|
||||
mkdir -p PKG
|
||||
pkgbuild --root PKGROOT --identifier org.nethack.term --scripts PKGSCRIPTS PKG/NH-Term.pkg
|
||||
productbuild --synthesize --product Info.plist --package PKG/NH-Term.pkg Distribution.xml
|
||||
productbuild --distribution Distribution.xml --resources RESOURCES --package-path PKG NetHack-$(SVS)-mac-Term-unsigned.pkg
|
||||
ifeq ($(DEVELOPER_CERT),NONE)
|
||||
cp NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term.pkg
|
||||
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term-unsigned.dmg
|
||||
@echo -------------------------------------------
|
||||
@echo PACKAGE IS NOT SIGNED FOR DISTRIBUTION!!!!!
|
||||
@echo ===========================================
|
||||
else
|
||||
@echo "run 'make sign_tty_pkg' to complete package"
|
||||
endif
|
||||
|
||||
sign_tty_pkg:
|
||||
productsign --timestamp=none --sign "$(DEVELOPER_CERT)" NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term.pkg || (echo "Package signing failed"; exit 1)
|
||||
spctl -a -v --type install NetHack-$(SVS)-mac-Term.pkg || (echo "Package not signed properly"; exit 1)
|
||||
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
|
||||
|
||||
build_package_root:
|
||||
cd src/.. # make sure we are at TOP
|
||||
rm -rf PKGROOT
|
||||
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_BIN) $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
|
||||
install -p src/nethack $(PKGROOT_BIN)
|
||||
# XXX should this be called nethackrecover?
|
||||
install -p util/recover $(PKGROOT_BIN)
|
||||
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
|
||||
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
|
||||
install -p doc/Guidebook $(PKGROOT_UG)/doc
|
||||
install -p dat/nhdat $(PKGROOT_UGLN)
|
||||
sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf
|
||||
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
|
||||
# XXX these files should be somewhere else for good Mac form
|
||||
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile
|
||||
mkdir $(PKGROOT_UGLN)/save
|
||||
# XXX what about a news file?
|
||||
|
||||
mkdir -p PKGSCRIPTS
|
||||
echo '#!/bin/sh' > PKGSCRIPTS/postinstall
|
||||
echo dseditgroup -o create -r '"Games Group"' -s 3600 $(GAMEGRP) >> PKGSCRIPTS/postinstall
|
||||
echo $(CHOWN) $(GAMEUID) $(HACKDIR) >> PKGSCRIPTS/postinstall
|
||||
echo $(CHOWN) $(GAMEUID) $(HACKDIR)/* >> PKGSCRIPTS/postinstall
|
||||
echo $(CHGRP) $(GAMEGRP) $(HACKDIR) >> PKGSCRIPTS/postinstall
|
||||
echo $(CHGRP) $(GAMEGRP) $(HACKDIR)/* >> PKGSCRIPTS/postinstall
|
||||
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
|
||||
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
|
||||
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
|
||||
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(VARDIRPERM) $(HACKDIR) >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(VARDIRPERM) $(HACKDIR)/save >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(FILEPERM) $(HACKDIR)/license >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(FILEPERM) $(HACKDIR)/nhdat >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(FILEPERM) $(HACKDIR)/symbols >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(VARFILEPERM) $(HACKDIR)/perm >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(VARFILEPERM) $(HACKDIR)/xlogfile >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(VARFILEPERM) $(HACKDIR)/sysconf >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(GAMEPERM) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
|
||||
echo chmod $(EXEPERM) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
|
||||
chmod 0775 PKGSCRIPTS/postinstall
|
||||
|
||||
endif # end of build_tty_pkg
|
||||
endif # WANT_WIN_TTY for packaging
|
||||
|
||||
ifdef WANT_WIN_QT
|
||||
# XXX untested and incomplete (see below)
|
||||
build_qt_pkg:
|
||||
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
|
||||
-echo build_qt_pkg only works for a qt-only build
|
||||
exit 1
|
||||
else
|
||||
$(MAKE) build_package_root
|
||||
rm -rf NetHackQt
|
||||
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
|
||||
mkdir NetHackQt/Documentation
|
||||
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
|
||||
|
||||
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
|
||||
win/macosx/NetHackRecover.applescript
|
||||
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
|
||||
|
||||
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
|
||||
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
|
||||
|
||||
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
|
||||
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
|
||||
|
||||
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
|
||||
|
||||
# XXX still missing:
|
||||
#NetHackQt/NetHackQt.app
|
||||
# /Contents
|
||||
# Info.plist
|
||||
# Resources/nethack.icns
|
||||
#NetHackQt/Documentation
|
||||
#NetHackQtRecover.txt
|
||||
#NetHack Defaults.txt
|
||||
#changes.patch XXX is this still needed? why isn't it part of the tree?
|
||||
# doesn't go here
|
||||
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
|
||||
endif # end of build_qt_pkg
|
||||
endif # WANT_WIN_QT for packaging
|
||||
endif # MAKEFILE_TOP
|
||||
@@ -34,40 +34,44 @@
|
||||
# BUILD DECISIONS SECTION
|
||||
#
|
||||
# There are currently only 4 decisions that you have to make.
|
||||
# 1. 32-bit or 64-bit?
|
||||
# 2. Where do you want your build to end up?
|
||||
# 3. Do you want debug information in the executable?
|
||||
# 4. Do you want additional GUI interfaces in the executable?
|
||||
#
|
||||
# Note that additional GUI interfaces may require external libraries.
|
||||
# Qt is placed where the official installer places it.
|
||||
# Other libraries are placed in a subdirectory of your home directory, either
|
||||
# x86libs or x64libs depending on whether you're building for 64 bits.
|
||||
#
|
||||
# 1. Where do you want your build to end up?
|
||||
# 2. Do you want debug information in the executable?
|
||||
# 3. Do you want to explicitly override auto-detection of a 32-bit or 64-bit target?
|
||||
# 4. Do you want to include any optional interfaces in the port?
|
||||
# 4a) curses
|
||||
# 4b) Qt
|
||||
#-----------------------------------------------------------------------------------------
|
||||
#=========================================================================================
|
||||
|
||||
#==============================================================================
|
||||
#---------------------------------------------------------------
|
||||
# 1. Where do you want the game to be built (which folder)?
|
||||
# If not present prior to compilation it gets created.
|
||||
#
|
||||
|
||||
GAMEDIR = ../binary
|
||||
|
||||
# 1. 32-bit or 64-bit?
|
||||
#
|
||||
|
||||
#
|
||||
#---------------------------------------------------------------
|
||||
# 2. Do you want debug information in the executable?
|
||||
#
|
||||
|
||||
DEBUGINFO = Y
|
||||
|
||||
#
|
||||
#---------------------------------------------------------------
|
||||
# 3. Do you want to explicitly override auto-detection of a 32-bit
|
||||
# or 64-bit executable (save files do not interchange currently)?
|
||||
#
|
||||
# 64 bit
|
||||
#TARGET_CPU=x64
|
||||
#
|
||||
# 32 bit
|
||||
TARGET_CPU=x86
|
||||
#
|
||||
#---------------------------------------------------------------
|
||||
# 2. Where do you want the game to be built (which folder)?
|
||||
# If not present prior to compilation it gets created.
|
||||
#
|
||||
|
||||
GAMEDIR = ../binary
|
||||
|
||||
#
|
||||
#---------------------------------------------------------------
|
||||
# 3. Do you want debug information in the executable?
|
||||
#
|
||||
|
||||
DEBUGINFO = Y
|
||||
|
||||
#
|
||||
#---------------------------------------------------------------
|
||||
# 4. Do you want additional GUI interfaces in the executable?
|
||||
@@ -75,19 +79,47 @@ DEBUGINFO = Y
|
||||
# and is the default.
|
||||
#
|
||||
|
||||
WANT_WIN_QT4 = N
|
||||
#4a Curses window port support
|
||||
#
|
||||
#
|
||||
# 4. Uncomment these and set them appropriately if you want to
|
||||
# include curses port support alongside TTY support in your
|
||||
# NetHack.exe binary.
|
||||
#
|
||||
# You'll have to set PDCURSES_H to the correct location of the
|
||||
# PDCurses header (.h) files and PDCURSES_C to the location
|
||||
# of your PDCurses C files which must already be resident on
|
||||
# your machine.
|
||||
#
|
||||
#ADD_CURSES=Y
|
||||
#PDCURSES_TOP=..\..\pdcurses
|
||||
|
||||
#4b Qt
|
||||
#
|
||||
#WANT_WIN_QT4 = N
|
||||
|
||||
# WANT_WIN_QT4 requires Qt 4 or Qt 5, see
|
||||
# https://www.qt.io/download-open-source/
|
||||
# Earlier versions of Qt are not compatible with Windows
|
||||
# For Qt 5, use:
|
||||
QT4_DIRECTORY = c:/Qt/Qt5.9.2/5.9.2/mingw53_32
|
||||
HAVE_QT5 = Y
|
||||
#
|
||||
#QT4_DIRECTORY = c:/Qt/Qt5.9.2/5.9.2/mingw53_32
|
||||
#HAVE_QT5 = Y
|
||||
|
||||
# For Qt 4, comment out the above two lines and use:
|
||||
#
|
||||
#QT4_DIRECTORY = c:/Qt/4.8.6
|
||||
#HAVE_QT5 = N
|
||||
|
||||
#
|
||||
# Note that additional GUI interfaces may require external libraries.
|
||||
# Qt is placed where the official installer places it.
|
||||
# Other libraries are placed in a subdirectory of your home directory, either
|
||||
# x86libs or x64libs depending on whether you're building for 64 bits.
|
||||
#
|
||||
|
||||
#
|
||||
#==============================================================================
|
||||
# This marks the end of the BUILD DECISIONS section.
|
||||
#==============================================================================
|
||||
#
|
||||
@@ -100,33 +132,24 @@ HAVE_QT5 = Y
|
||||
# Nothing below here should have to be changed.#
|
||||
# #
|
||||
################################################
|
||||
#
|
||||
#==============================================================================
|
||||
|
||||
#
|
||||
# Source directories. Makedefs hardcodes these, don't change them.
|
||||
#
|
||||
|
||||
# NetHack include files
|
||||
INCL = ../include
|
||||
# NetHack data files
|
||||
DAT = ../dat
|
||||
# NetHack documentation files
|
||||
DOC = ../doc
|
||||
# Utility source
|
||||
UTIL = ../util
|
||||
# Main source
|
||||
SRC = ../src
|
||||
# Shared system files
|
||||
SSYS = ../sys/share
|
||||
# NT Win32 specific files
|
||||
MSWSYS = ../sys/winnt
|
||||
# window port files (tty)
|
||||
TTY = ../win/tty
|
||||
# window port files (WIN32)
|
||||
MSWIN = ../win/win32
|
||||
# window port files (Qt4)
|
||||
QT4 = ../win/Qt4
|
||||
# Tile support files
|
||||
WSHR = ../win/share
|
||||
INCL = ../include # NetHack include files
|
||||
DAT = ../dat # NetHack data files
|
||||
DOC = ../doc # NetHack documentation files
|
||||
UTIL = ../util # Utility source
|
||||
SRC = ../src # Main source
|
||||
SSYS = ../sys/share # Shared system files
|
||||
MSWSYS = ../sys/winnt # mswin specific files
|
||||
TTY = ../win/tty # window port files (tty)
|
||||
MSWIN = ../win/win32 # window port files (win32)
|
||||
WCURSES = ../win/curses # window port files (curses)
|
||||
WSHR = ../win/share # Tile support files
|
||||
|
||||
#
|
||||
# Object directory.
|
||||
@@ -142,46 +165,6 @@ ifeq "$(WANT_WIN_QT4)" "Y"
|
||||
link = g++
|
||||
endif
|
||||
|
||||
#
|
||||
#==========================================
|
||||
# Level Compiler Info
|
||||
#==========================================
|
||||
|
||||
# Yacc/Lex ... if you got 'em.
|
||||
#
|
||||
# If you have yacc and lex programs (or work-alike such as bison
|
||||
# and flex), comment out the upper two macros and uncomment
|
||||
# the lower two.
|
||||
#
|
||||
|
||||
DO_YACC = YACC_MSG
|
||||
DO_LEX = LEX_MSG
|
||||
#DO_YACC = YACC_ACT
|
||||
#DO_LEX = LEX_ACT
|
||||
|
||||
# - Specify your yacc and lex programs (or work-alikes) here.
|
||||
|
||||
#YACC = bison -y
|
||||
YACC = byacc
|
||||
#YACC = yacc
|
||||
|
||||
#LEX = lex
|
||||
LEX = flex
|
||||
|
||||
#
|
||||
# - Specify your flex skeleton file (if needed).
|
||||
#
|
||||
|
||||
FLEXSKEL =
|
||||
#FLEXSKEL = -S../tools/flex.ske
|
||||
|
||||
YTABC = y_tab.c
|
||||
YTABH = y_tab.h
|
||||
LEXYYC = lexyy.c
|
||||
|
||||
#==========================================
|
||||
# Exe File Info.
|
||||
#==========================================
|
||||
#
|
||||
# Optional high-quality BSD random number generation routines
|
||||
# (see pcconf.h). Set to nothing if not used.
|
||||
@@ -206,10 +189,22 @@ else
|
||||
DLBFLG =
|
||||
endif
|
||||
|
||||
#
|
||||
# If you defined ZLIB_COMP in include/config.h and you need
|
||||
# to link with the zlib.lib library, uncomment the line below.
|
||||
# If necessary, prefix explicit path information to the file name
|
||||
# otherwise it assumes the NetHack src directory.
|
||||
#
|
||||
|
||||
#ZLIB = zlib.lib
|
||||
|
||||
#==========================================
|
||||
#==========================================
|
||||
# Setting up the compiler and linker
|
||||
# macros. All builds include the base ones.
|
||||
#==========================================
|
||||
#==========================================
|
||||
|
||||
cflags = -mms-bitfields
|
||||
lflags =
|
||||
ifeq "$(DEBUGINFO)" "Y"
|
||||
@@ -220,8 +215,6 @@ cdebug =
|
||||
linkdebug =
|
||||
endif
|
||||
|
||||
|
||||
|
||||
CFLAGSBASE = -c $(cflags) -I$(INCL) $(WINPINC) $(cdebug)
|
||||
#LFLAGSBASEC = $(linkdebug)
|
||||
#LFLAGSBASEG = $(linkdebug) -mwindows
|
||||
@@ -322,7 +315,7 @@ RECOVOBJS = $(O)recover.o
|
||||
TILEFILES = $(WSHR)/monsters.txt $(WSHR)/objects.txt $(WSHR)/other.txt
|
||||
|
||||
#
|
||||
# These are not invoked during a normal game build in 3.4
|
||||
# These are not invoked during a normal game build in 3.4+
|
||||
#
|
||||
TEXT_IO = $(O)tiletext.o $(O)tiletxt.o $(O)drawing.o \
|
||||
$(O)decl.o $(O)monst.o $(O)objects.o
|
||||
@@ -340,19 +333,19 @@ PPMWRITERS = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o
|
||||
#
|
||||
|
||||
VOBJ01 = $(O)allmain.o $(O)alloc.o $(O)apply.o $(O)artifact.o
|
||||
VOBJ02 = $(O)attrib.o $(O)ball.o $(O)bones.o $(O)botl.o
|
||||
VOBJ03 = $(O)cmd.o $(O)dbridge.o $(O)decl.o $(O)detect.o
|
||||
VOBJ04 = $(O)dig.o $(O)display.o $(O)do.o $(O)do_name.o
|
||||
VOBJ05 = $(O)do_wear.o $(O)dog.o $(O)dogmove.o $(O)dokick.o
|
||||
VOBJ06 = $(O)dothrow.o $(O)drawing.o $(O)dungeon.o $(O)eat.o
|
||||
VOBJ07 = $(O)end.o $(O)engrave.o $(O)exper.o $(O)explode.o
|
||||
VOBJ08 = $(O)extralev.o $(O)files.o $(O)fountain.o $(O)hack.o
|
||||
VOBJ09 = $(O)hacklib.o $(O)invent.o $(O)light.o $(O)lock.o
|
||||
VOBJ10 = $(O)mail.o $(O)makemon.o $(O)mapglyph.o $(O)mcastu.o
|
||||
VOBJ11 = $(O)mhitm.o $(O)mhitu.o $(O)minion.o $(O)mklev.o
|
||||
VOBJ12 = $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o $(O)mkroom.o
|
||||
VOBJ13 = $(O)mon.o $(O)mondata.o $(O)monmove.o $(O)monst.o
|
||||
VOBJ14 = $(O)mplayer.o $(O)mthrowu.o $(O)muse.o
|
||||
VOBJ02 = $(O)attrib.o $(O)ball.o $(O)bones.o $(O)botl.o
|
||||
VOBJ03 = $(O)cmd.o $(O)dbridge.o $(O)decl.o $(O)detect.o
|
||||
VOBJ04 = $(O)dig.o $(O)display.o $(O)do.o $(O)do_name.o
|
||||
VOBJ05 = $(O)do_wear.o $(O)dog.o $(O)dogmove.o $(O)dokick.o
|
||||
VOBJ06 = $(O)dothrow.o $(O)drawing.o $(O)dungeon.o $(O)eat.o
|
||||
VOBJ07 = $(O)end.o $(O)engrave.o $(O)exper.o $(O)explode.o
|
||||
VOBJ08 = $(O)extralev.o $(O)files.o $(O)fountain.o $(O)hack.o
|
||||
VOBJ09 = $(O)hacklib.o $(O)invent.o $(O)light.o $(O)lock.o
|
||||
VOBJ10 = $(O)mail.o $(O)pcmain.o $(O)makemon.o $(O)mapglyph.o
|
||||
VOBJ11 = $(O)mcastu.o $(O)mhitm.o $(O)mhitu.o $(O)minion.o
|
||||
VOBJ12 = $(O)mklev.o $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o
|
||||
VOBJ13 = $(O)mkroom.o $(O)mon.o $(O)mondata.o $(O)monmove.o
|
||||
VOBJ14 = $(O)monst.o $(O)mplayer.o $(O)mthrowu.o $(O)muse.o
|
||||
VOBJ15 = $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o
|
||||
VOBJ16 = $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o
|
||||
VOBJ17 = $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o
|
||||
@@ -366,6 +359,7 @@ VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o
|
||||
VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o
|
||||
VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o
|
||||
VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o
|
||||
VOBJ28 = $(O)win10.o
|
||||
|
||||
DLBOBJ = $(O)dlb.o
|
||||
|
||||
@@ -373,20 +367,29 @@ REGEX = $(O)cppregex.o
|
||||
|
||||
TTYOBJ = $(O)topl.o $(O)getline.o $(O)wintty.o
|
||||
|
||||
!IFNDEF ADD_CURSES
|
||||
CURSESOBJ=
|
||||
!ELSE
|
||||
CURSESOBJ= $(O)cursdial.o $(O)cursinit.o $(O)cursinvt.o $(O)cursmain.o \
|
||||
$(O)cursmesg.o $(O)cursmisc.o $(O)cursstat.o $(O)curswins.o
|
||||
!ENDIF
|
||||
|
||||
SOBJ = $(O)winnt.o $(O)pcsys.o $(O)pcunix.o \
|
||||
$(SOUND) $(O)pcmain.o $(O)nhlan.o
|
||||
|
||||
OBJS = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
|
||||
$(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \
|
||||
$(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
|
||||
$(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
|
||||
$(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
|
||||
$(VOBJ26) $(VOBJ27) $(REGEX)
|
||||
$(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \
|
||||
$(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
|
||||
$(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
|
||||
$(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
|
||||
$(VOBJ26) $(VOBJ27) $(VOBJ28) $(VOBJ29) $(REGEX) \
|
||||
$(CURSESOBJ)
|
||||
|
||||
GUIOBJ = $(O)mhaskyn.o $(O)mhdlg.o \
|
||||
$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
|
||||
$(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \
|
||||
$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
|
||||
|
||||
ifeq "$(WANT_WIN_QT4)" "Y"
|
||||
GUIOBJ += $(O)qt4bind.o $(O)qt4click.o $(O)qt4clust.o $(O)qt4delay.o \
|
||||
$(O)qt4glyph.o $(O)qt4icon.o $(O)qt4inv.o $(O)qt4key.o $(O)qt4line.o \
|
||||
@@ -400,6 +403,7 @@ GUIHDR = $(MSWIN)/mhaskyn.h $(MSWIN)/mhdlg.h $(MSWIN)/mhfont.h \
|
||||
$(MSWIN)/mhmenu.h $(MSWIN)/mhmsg.h $(MSWIN)/mhmsgwnd.h \
|
||||
$(MSWIN)/mhrip.h $(MSWIN)/mhstatus.h \
|
||||
$(MSWIN)/mhtext.h $(MSWIN)/resource.h $(MSWIN)/winMS.h
|
||||
|
||||
ifeq "$(WANT_WIN_QT4)" "Y"
|
||||
GUIHDR += $(QT4)/qt4bind.h $(QT4)/qt4click.h $(QT4)/qt4clust.h \
|
||||
$(QT4)/qt4delay.h $(QT4)/qt4glyph.h $(QT4)/qt4icon.h $(QT4)/qt4inv.h \
|
||||
@@ -410,7 +414,10 @@ ifeq "$(WANT_WIN_QT4)" "Y"
|
||||
$(QT4)/qt4yndlg.h
|
||||
endif
|
||||
|
||||
KEYDLLS = $(GAMEDIR)/nhdefkey.dll $(GAMEDIR)/nh340key.dll $(GAMEDIR)/nhraykey.dll
|
||||
COMCTRL = comctl32.lib
|
||||
|
||||
KEYDLLS = $(GAMEDIR)/nhdefkey.dll $(GAMEDIR)/nh340key.dll \
|
||||
$(GAMEDIR)/nhraykey.dll
|
||||
|
||||
TILEUTIL16 = $(UTIL)/tile2bmp.exe
|
||||
TILEBMP16 = $(SRC)/tiles.bmp
|
||||
@@ -427,6 +434,35 @@ ALLOBJ = $(SOBJ) $(DLBOBJ) $(WOBJ) $(OBJS) $(VVOBJ)
|
||||
|
||||
OPTIONS_FILE = $(DAT)\options
|
||||
|
||||
ifeq "$(ADD_CURSES)" "Y"
|
||||
#==========================================
|
||||
# PDCurses build macros
|
||||
#==========================================
|
||||
PDCURSES_CURSES_H = $(PDCURSES_TOP)/curses.h
|
||||
PDCURSES_CURSPRIV_H = $(PDCURSES_TOP)/curspriv.h
|
||||
PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H)
|
||||
PDCSRC = $(PDCURSES_TOP)/pdcurses
|
||||
PDCWINCON = $(PDCURSES_TOP)/wincon
|
||||
PDCLIBOBJS = $(O)addch.o $(O)addchstr.o $(O)addstr.o $(O)attr.o $(O)beep.o \
|
||||
$(O)bkgd.o $(O)border.o $(O)clear.o $(O)color.o $(O)delch.o $(O)deleteln.o \
|
||||
$(O)deprec.o $(O)getch.o $(O)getstr.o $(O)getyx.o $(O)inch.o $(O)inchstr.o \
|
||||
$(O)initscr.o $(O)inopts.o $(O)insch.o $(O)insstr.o $(O)instr.o $(O)kernel.o \
|
||||
$(O)keyname.o $(O)mouse.o $(O)move.o $(O)outopts.o $(O)overlay.o $(O)pad.o \
|
||||
$(O)panel.o $(O)printw.o $(O)refresh.o $(O)scanw.o $(O)scr_dump.o $(O)scroll.o \
|
||||
$(O)slk.o $(O)termattr.o $(O)terminfo.o $(O)touch.o $(O)util.o $(O)window.o \
|
||||
$(O)debug.o
|
||||
|
||||
PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o \
|
||||
$(O)pdcsetsc.o $(O)pdcutil.o
|
||||
|
||||
PDCLIB = $(O)pdcurses.a
|
||||
|
||||
PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC) /I$(PDCWINCON)
|
||||
|
||||
else
|
||||
PDCLIB =
|
||||
endif
|
||||
|
||||
#==========================================
|
||||
# Header file macros
|
||||
#==========================================
|
||||
@@ -464,6 +500,25 @@ TILE_H = ../win/share/tile.h
|
||||
|
||||
DATABASE = $(DAT)/data.base
|
||||
|
||||
#==========================================
|
||||
# More compiler setup post-macros
|
||||
#==========================================
|
||||
#
|
||||
ifeq "$(ADD_CURSES)" "Y"
|
||||
#CURSESDEF=-D"PDC_DLL_BUILD" -D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
|
||||
CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
|
||||
else
|
||||
CURSDEF=
|
||||
CURSESLIB=
|
||||
CURSESINCL=
|
||||
endif
|
||||
|
||||
ifneq "$(ADD_CURSES)" "Y"
|
||||
INCLDIR= /I../include /I../sys/winnt
|
||||
else
|
||||
INCLDIR= /I../include /I../sys/winnt /I$(CURSESINCL)
|
||||
endif
|
||||
|
||||
#==========================================
|
||||
#================ RULES ==================
|
||||
#==========================================
|
||||
@@ -534,6 +589,63 @@ $(OBJ)/%.o : $(TTY)/%.c
|
||||
$(OBJ)/%.o : $(MSWIN)/%.c
|
||||
$(cc) $(CFLAGS) -o$@ $<
|
||||
|
||||
#==========================================
|
||||
# Rules for files in win\curses
|
||||
#==========================================
|
||||
|
||||
$(OBJ)/%.o : $(WCURSES)/%.c
|
||||
$(cc) $(CFLAGS) -o$@ $<
|
||||
|
||||
#==========================================
|
||||
# Rules for files in PDCurses
|
||||
#==========================================
|
||||
|
||||
$(OBJ)/%.o : $(PDCURSES_TOP)/%.c
|
||||
$(cc) $(PDCINCL) $(CFLAGS) -o$@ $<
|
||||
|
||||
$(OBJ)/%.o : $(PDCSRC)/%.c
|
||||
$(cc) $(PDCINCL) $(CFLAGS) -o$@ $<
|
||||
|
||||
$(OBJ)/%.o : $(PDCWINCON)/%.c
|
||||
$(cc) $(PDCINCL) $(CFLAGS) -o$@ $<
|
||||
|
||||
#==========================================
|
||||
# Level Compiler Info
|
||||
#==========================================
|
||||
|
||||
# Yacc/Lex ... if you got 'em.
|
||||
#
|
||||
# If you have yacc and lex programs (or work-alike such as bison
|
||||
# and flex), comment out the upper two macros and uncomment
|
||||
# the lower two.
|
||||
#
|
||||
|
||||
DO_YACC = YACC_MSG
|
||||
DO_LEX = LEX_MSG
|
||||
#DO_YACC = YACC_ACT
|
||||
#DO_LEX = LEX_ACT
|
||||
|
||||
# - Specify your yacc and lex programs (or work-alikes) here.
|
||||
|
||||
#YACC = bison -y
|
||||
YACC = byacc
|
||||
#YACC = yacc
|
||||
|
||||
#LEX = lex
|
||||
LEX = flex
|
||||
|
||||
#
|
||||
# - Specify your flex skeleton file (if needed).
|
||||
#
|
||||
|
||||
FLEXSKEL =
|
||||
#FLEXSKEL = -S../tools/flex.ske
|
||||
|
||||
YTABC = y_tab.c
|
||||
YTABH = y_tab.h
|
||||
LEXYYC = lexyy.c
|
||||
|
||||
|
||||
#==========================================
|
||||
# Rules for files in win/Qt4
|
||||
#==========================================
|
||||
@@ -591,7 +703,12 @@ endif
|
||||
$(subst /,\,if exist $(DAT)/symbols copy $(DAT)/symbols $(GAMEDIR))
|
||||
$(subst /,\,if exist $(DOC)/guidebook.txt copy $(DOC)/guidebook.txt $(GAMEDIR)/Guidebook.txt)
|
||||
$(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR)/NetHack.txt)
|
||||
$(subst /,\,copy $(MSWSYS)/defaults.nh $(GAMEDIR)/defaults.nh)
|
||||
$(U)makedefs -c
|
||||
$(subst /,\,if not exist $(GAMEDIR)/defaults.nh copy fixed_defaults.nh $(GAMEDIR)/defaults.nh)
|
||||
$(subst /,\,if not exist $(GAMEDIR)/defaults.nh copy $(MSWSYS)/defaults.nh $(GAMEDIR)/defaults.nh)
|
||||
$(subst /,\,if not exist $(GAMEDIR)/record. goto>$(GAMEDIR)/record.)
|
||||
#
|
||||
#
|
||||
$(subst /,\,echo install done > $@)
|
||||
|
||||
# copy $(MSWSYS)/winnt.hlp $(GAMEDIR)
|
||||
@@ -662,18 +779,26 @@ $(O)gamedir.tag:
|
||||
$(subst /,\,@if not exist $(GAMEDIR)/*.* mkdir $(GAMEDIR))
|
||||
$(subst /,\,@echo directory created > $@)
|
||||
|
||||
$(GAMEDIR)/NetHack.exe : $(O)gamedir.tag $(O)tile.o $(O)nttty.o $(O)guistub.o \
|
||||
$(GAMEDIR)/NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \
|
||||
$(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)conres.o $(KEYDLLS)
|
||||
@echo Linking $@...
|
||||
$(link) $(lflags) -o$@ $(ALLOBJ) $(TTYOBJ) $(O)nttty.o $(O)tile.o \
|
||||
$(O)guistub.o $(O)conres.o $(conlibs) -static -lstdc++
|
||||
$(O)guistub.o $(O)conres.o $(PDCLIB) $(conlibs) -static -lstdc++
|
||||
$(subst /,\,@if exist $(O)install.tag del $(O)install.tag)
|
||||
|
||||
# NetHackW
|
||||
# full tty linkage libs:
|
||||
# libs: $(LIBS) $(guilibs) $(COMCTRL)
|
||||
# objs: $(GAMEOBJ) $(GUIOBJ) $(TTYOBJ) $(O)tile.o $(O)nttty.o
|
||||
# otherwise:
|
||||
# libs: $(LIBS) $(guilibs) $(COMCTRL)
|
||||
# objs: $(GAMEOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o
|
||||
|
||||
$(GAMEDIR)/NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \
|
||||
$(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winres.o $(KEYDLLS)
|
||||
@echo Linking $@...
|
||||
$(link) $(lflags) -mwindows -o$@ $(ALLOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o \
|
||||
$(O)winres.o $(guilibs) -static -lstdc++
|
||||
$(O)winres.o $(PDCLIB) $(guilibs) -static -lstdc++
|
||||
$(subst /,\,@if exist $(O)install.tag del $(O)install.tag)
|
||||
|
||||
$(O)nhdefkey.o:
|
||||
@@ -713,9 +838,10 @@ graphicschk:
|
||||
@echo ----
|
||||
$(subst /,\,@echo graphicschk > graphicschk)
|
||||
|
||||
#
|
||||
# Secondary Targets.
|
||||
#
|
||||
|
||||
#==========================================
|
||||
#=========== SECONDARY TARGETS ============
|
||||
#==========================================
|
||||
|
||||
#==========================================
|
||||
# Makedefs Stuff
|
||||
@@ -920,6 +1046,24 @@ else
|
||||
$(subst /,\,echo.>>$@)
|
||||
endif
|
||||
|
||||
#=================================================
|
||||
# For a couple of devteam utilities
|
||||
#=================================================
|
||||
|
||||
$(U)nhsizes.exe: $(O)nhsizes.o
|
||||
@echo Linking $@...
|
||||
@$(link) $(LFLAGSU) -o$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o$(U)nhsizes.exe: $(O)nhsizes.o
|
||||
|
||||
$(U)nhsize2.exe: $(O)nhsizes2.o
|
||||
@echo Linking $@...
|
||||
@$(link) $(LFLAGSU) -o$@ $(O)nhsizes2.o $(O)panic.o $(O)alloc.o
|
||||
|
||||
$(O)nhsizes.o: $(CONFIG_H) nhsizes.c
|
||||
$(cc) $(CFLAGSU) -o$@ nhsizes.c
|
||||
|
||||
$(O)nhsizes2.o: $(CONFIG_H) nhsizes2.c
|
||||
$(cc) $(CFLAGSU) -o$@ nhsizes2.c
|
||||
|
||||
#==========================================
|
||||
# Create directory for holding object files
|
||||
#==========================================
|
||||
@@ -929,19 +1073,6 @@ $(O)obj.tag:
|
||||
$(subst /,\,@if not exist $(OBJ)/*.* mkdir $(OBJ))
|
||||
$(subst /,\,@echo directory created > $@)
|
||||
|
||||
|
||||
#==========================================
|
||||
#=========== SECONDARY TARGETS ============
|
||||
#==========================================
|
||||
|
||||
#===========================================
|
||||
# Header files NOT distributed in ../include
|
||||
#===========================================
|
||||
|
||||
$(INCL)/win32api.h: $(MSWSYS)/win32api.h
|
||||
$(subst /,\,copy $(MSWSYS)/win32api.h $@)
|
||||
|
||||
|
||||
#==========================================
|
||||
# DLB utility and nhdat file creation
|
||||
#==========================================
|
||||
@@ -1072,6 +1203,13 @@ $(O)tile2bmp.o: $(WSHR)/tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h
|
||||
$(O)til2bm32.o: $(WSHR)/til2bm32.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h
|
||||
$(cc) $(CFLAGS) -I$(WSHR) -DTILE_X=32 -DTILE_Y=32 -o$@ $(WSHR)/til2bm32.c
|
||||
|
||||
#==========================================
|
||||
# PDCurses Library
|
||||
#==========================================
|
||||
|
||||
$(O)pdcurses.a : $(PDCLIBOBJS) $(PDCOBJS)
|
||||
ar rcs $@ $(PDCLIBOBJS) $(PDCOBJS)
|
||||
|
||||
#==========================================
|
||||
# Housekeeping
|
||||
#==========================================
|
||||
@@ -1155,7 +1293,9 @@ spotless: clean
|
||||
ifneq "$(OBJ)" ""
|
||||
$(subst /,\,if exist $(OBJ) rmdir $(OBJ)) /s /Q
|
||||
endif
|
||||
|
||||
ifeq "$(ADD_CURSES)" == "Y"
|
||||
if exist $(O)pdcurses.lib del $(O)pdcurses.lib
|
||||
endif
|
||||
clean:
|
||||
$(subst /,\,if exist $(O)*.o del $(O)*.o)
|
||||
$(subst /,\,if exist $(O)utility.tag del $(O)utility.tag)
|
||||
@@ -1173,41 +1313,6 @@ clean:
|
||||
#===================================================================
|
||||
# OTHER DEPENDENCIES
|
||||
#===================================================================
|
||||
|
||||
# Other files needed by some ports
|
||||
$(GAMEDIR)/Qt5Core.dll : $(QT4_DIRECTORY)/bin/Qt5Core.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/Qt5Gui.dll : $(QT4_DIRECTORY)/bin/Qt5Gui.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/Qt5Widgets.dll : $(QT4_DIRECTORY)/bin/Qt5Widgets.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/QtCore4.dll : $(QT4_DIRECTORY)/bin/QtCore4.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/QtGui4.dll : $(QT4_DIRECTORY)/bin/QtGui4.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/nhtiles.bmp : $(SRC)/tiles.bmp
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/rip.xpm : ../win/X11/rip.xpm
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
|
||||
# Dependencies on .moc files (for Qt 4 or 5)
|
||||
$(OBJ)/qt4main.o : $(QT4)/qt4main.cpp $(QT4)/qt4main.moc $(QT4)/qt4kde0.moc
|
||||
$(OBJ)/qt4map.o : $(QT4)/qt4map.cpp $(QT4)/qt4map.moc
|
||||
$(OBJ)/qt4menu.o : $(QT4)/qt4menu.cpp $(QT4)/qt4menu.moc
|
||||
$(OBJ)/qt4msg.o : $(QT4)/qt4msg.cpp $(QT4)/qt4msg.moc
|
||||
$(OBJ)/qt4plsel.o : $(QT4)/qt4plsel.cpp $(QT4)/qt4plsel.moc
|
||||
$(OBJ)/qt4set.o : $(QT4)/qt4set.cpp $(QT4)/qt4set.moc
|
||||
$(OBJ)/qt4stat.o : $(QT4)/qt4stat.cpp $(QT4)/qt4stat.moc
|
||||
$(OBJ)/qt4xcmd.o : $(QT4)/qt4xcmd.cpp $(QT4)/qt4xcmd.moc
|
||||
$(OBJ)/qt4yndlg.o : $(QT4)/qt4yndlg.cpp $(QT4)/qt4yndlg.moc
|
||||
|
||||
#
|
||||
# dat dependencies
|
||||
#
|
||||
@@ -1224,6 +1329,15 @@ $(DAT)/quest.dat: $(O)utility.tag $(DAT)/quest.txt
|
||||
$(DAT)/oracles: $(O)utility.tag $(DAT)/oracles.txt
|
||||
$(subst /,\,$(U)makedefs -h)
|
||||
|
||||
$(DAT)/engrave: $(DAT)/engrave.txt $(U)makedefs.exe
|
||||
$(U)makedefs -s
|
||||
|
||||
$(DAT)/epitaph: $(DAT)/epitaph.txt $(U)makedefs.exe
|
||||
$(U)makedefs -s
|
||||
|
||||
$(DAT)/bogusmon: $(DAT)/bogusmon.txt $(U)makedefs.exe
|
||||
$(U)makedefs -s
|
||||
|
||||
$(DAT)/dungeon: $(O)utility.tag $(DAT)/dungeon.def
|
||||
$(subst /,\,$(U)makedefs -e)
|
||||
$(subst /,\,$(U)dgncomp $(DAT)/dungeon.pdf)
|
||||
@@ -1261,6 +1375,63 @@ $(O)tile.o: $(SRC)/tile.c $(HACK_H)
|
||||
$(O)panic.o: $(U)panic.c $(CONFIG_H)
|
||||
$(cc) $(CFLAGS) -o$@ $(U)panic.c
|
||||
|
||||
#
|
||||
# sys/share dependencies
|
||||
#
|
||||
|
||||
(O)cppregex.o: $(O)cppregex.cpp $(HACK_H)
|
||||
$(cc) $(CFLAGS) -o$@ ../sys/share/cppregex.cpp
|
||||
|
||||
#
|
||||
# Other dependencies needed by some ports
|
||||
#
|
||||
|
||||
# curses window port dependencies
|
||||
|
||||
$(O)cursdial.o: $(WCURSES)\cursdial.c $(WCURSES)\cursdial.h $(INCL)\wincurs.h
|
||||
$(O)cursinit.c: $(WCURSES)\cursinit.c $(WCURSES)\cursinit.h $(INCL)\wincurs.h
|
||||
$(O)cursinvt.c: $(WCURSES)\cursinvt.c $(WCURSES)\cursinvt.h $(INCL)\wincurs.h
|
||||
$(O)cursmain.c: $(WCURSES)\cursmain.c $(WCURSES)\cursmain.h $(INCL)\wincurs.h
|
||||
$(O)cursmesg.c: $(WCURSES)\cursmesg.c $(WCURSES)\cursmesg.h $(INCL)\wincurs.h
|
||||
$(O)cursmisc.c: $(WCURSES)\cursmisc.c $(WCURSES)\cursmisc.h $(INCL)\wincurs.h
|
||||
$(O)cursstat.c: $(WCURSES)\cursstat.c $(WCURSES)\cursstat.h $(INCL)\wincurs.h
|
||||
$(O)curswins.c: $(WCURSES)\curswins.c $(WCURSES)\curswins.h $(INCL)\wincurs.h
|
||||
|
||||
# Qt dependencies
|
||||
|
||||
$(GAMEDIR)/Qt5Core.dll : $(QT4_DIRECTORY)/bin/Qt5Core.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/Qt5Gui.dll : $(QT4_DIRECTORY)/bin/Qt5Gui.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/Qt5Widgets.dll : $(QT4_DIRECTORY)/bin/Qt5Widgets.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/QtCore4.dll : $(QT4_DIRECTORY)/bin/QtCore4.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/QtGui4.dll : $(QT4_DIRECTORY)/bin/QtGui4.dll
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/nhtiles.bmp : $(SRC)/tiles.bmp
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
$(GAMEDIR)/rip.xpm : ../win/X11/rip.xpm
|
||||
$(subst /,\,@copy $< $@ >nul)
|
||||
|
||||
|
||||
# Dependencies on .moc files (for Qt 4 or 5)
|
||||
$(OBJ)/qt4main.o : $(QT4)/qt4main.cpp $(QT4)/qt4main.moc $(QT4)/qt4kde0.moc
|
||||
$(OBJ)/qt4map.o : $(QT4)/qt4map.cpp $(QT4)/qt4map.moc
|
||||
$(OBJ)/qt4menu.o : $(QT4)/qt4menu.cpp $(QT4)/qt4menu.moc
|
||||
$(OBJ)/qt4msg.o : $(QT4)/qt4msg.cpp $(QT4)/qt4msg.moc
|
||||
$(OBJ)/qt4plsel.o : $(QT4)/qt4plsel.cpp $(QT4)/qt4plsel.moc
|
||||
$(OBJ)/qt4set.o : $(QT4)/qt4set.cpp $(QT4)/qt4set.moc
|
||||
$(OBJ)/qt4stat.o : $(QT4)/qt4stat.cpp $(QT4)/qt4stat.moc
|
||||
$(OBJ)/qt4xcmd.o : $(QT4)/qt4xcmd.cpp $(QT4)/qt4xcmd.moc
|
||||
$(OBJ)/qt4yndlg.o : $(QT4)/qt4yndlg.cpp $(QT4)/qt4yndlg.moc
|
||||
|
||||
#
|
||||
# The rest are stolen from sys/unix/Makefile.src,
|
||||
# with the following changes:
|
||||
|
||||
@@ -71,10 +71,11 @@ DEBUGINFO = Y
|
||||
#
|
||||
# You'll have to set PDCURSES_H to the correct location of the
|
||||
# PDCurses header (.h) files and PDCURSES_C to the location
|
||||
# of your PDCurses C files.
|
||||
# of your PDCurses C files which must already be resident on
|
||||
# your machine.
|
||||
#
|
||||
#ADD_CURSES=Y
|
||||
#PDCURSES_TOP=..\..\pdcurses
|
||||
ADD_CURSES=Y
|
||||
PDCURSES_TOP=..\..\pdcurses
|
||||
#
|
||||
#==============================================================================
|
||||
# This marks the end of the BUILD DECISIONS section.
|
||||
@@ -89,13 +90,9 @@ DEBUGINFO = Y
|
||||
# Nothing below here should have to be changed.#
|
||||
# #
|
||||
################################################
|
||||
|
||||
#
|
||||
#==============================================================================
|
||||
|
||||
# Set the gamedir according to your preference.
|
||||
# If not present prior to compilation it gets created.
|
||||
|
||||
#
|
||||
# Source directories. Makedefs hardcodes these, don't change them.
|
||||
#
|
||||
@@ -122,11 +119,6 @@ cc=cl
|
||||
link=link
|
||||
rc=Rc
|
||||
|
||||
#
|
||||
#==========================================
|
||||
# Exe File Info.
|
||||
#==========================================
|
||||
|
||||
#
|
||||
#
|
||||
# Optional high-quality BSD random number generation routines
|
||||
@@ -280,7 +272,7 @@ RECOVOBJS = $(O)recover.o
|
||||
TILEFILES = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt
|
||||
|
||||
#
|
||||
# These are not invoked during a normal game build in 3.4
|
||||
# These are not invoked during a normal game build in 3.4+
|
||||
#
|
||||
TEXT_IO = $(O)tiletext.o $(O)tiletxt.o $(O)drawing.o \
|
||||
$(O)decl.o $(O)monst.o $(O)objects.o
|
||||
@@ -306,19 +298,19 @@ VOBJ06 = $(O)dothrow.o $(O)drawing.o $(O)dungeon.o $(O)eat.o
|
||||
VOBJ07 = $(O)end.o $(O)engrave.o $(O)exper.o $(O)explode.o
|
||||
VOBJ08 = $(O)extralev.o $(O)files.o $(O)fountain.o $(O)hack.o
|
||||
VOBJ09 = $(O)hacklib.o $(O)invent.o $(O)light.o $(O)lock.o
|
||||
VOBJ10 = $(O)mail.o $(O)pcmain.o $(O)makemon.o $(O)mapglyph.o $(O)mcastu.o
|
||||
VOBJ11 = $(O)mhitm.o $(O)mhitu.o $(O)minion.o $(O)mklev.o
|
||||
VOBJ12 = $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o $(O)mkroom.o
|
||||
VOBJ13 = $(O)mon.o $(O)mondata.o $(O)monmove.o $(O)monst.o
|
||||
VOBJ14 = $(O)mplayer.o $(O)mthrowu.o $(O)muse.o
|
||||
VOBJ15 = $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o
|
||||
VOBJ16 = $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o
|
||||
VOBJ17 = $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o
|
||||
VOBJ18 = $(O)quest.o $(O)questpgr.o $(RANDOM) $(O)read.o
|
||||
VOBJ19 = $(O)rect.o $(O)region.o $(O)restore.o $(O)rip.o
|
||||
VOBJ20 = $(O)rnd.o $(O)role.o $(O)rumors.o $(O)save.o
|
||||
VOBJ21 = $(O)shk.o $(O)shknam.o $(O)sit.o $(O)sounds.o
|
||||
VOBJ22 = $(O)sp_lev.o $(O)spell.o $(O)steal.o $(O)steed.o
|
||||
VOBJ10 = $(O)mail.o $(O)pcmain.o $(O)makemon.o $(O)mapglyph.o
|
||||
VOBJ11 = $(O)mcastu.o $(O)mhitm.o $(O)mhitu.o $(O)minion.o
|
||||
VOBJ12 = $(O)mklev.o $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o
|
||||
VOBJ13 = $(O)mkroom.o $(O)mon.o $(O)mondata.o $(O)monmove.o
|
||||
VOBJ14 = $(O)monst.o $(O)mplayer.o $(O)mthrowu.o $(O)muse.o
|
||||
VOBJ15 = $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o
|
||||
VOBJ16 = $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o
|
||||
VOBJ17 = $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o
|
||||
VOBJ18 = $(O)quest.o $(O)questpgr.o $(RANDOM) $(O)read.o
|
||||
VOBJ19 = $(O)rect.o $(O)region.o $(O)restore.o $(O)rip.o
|
||||
VOBJ20 = $(O)rnd.o $(O)role.o $(O)rumors.o $(O)save.o
|
||||
VOBJ21 = $(O)shk.o $(O)shknam.o $(O)sit.o $(O)sounds.o
|
||||
VOBJ22 = $(O)sp_lev.o $(O)spell.o $(O)steal.o $(O)steed.o
|
||||
VOBJ23 = $(O)sys.o $(O)teleport.o $(O)timeout.o $(O)topten.o
|
||||
VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o
|
||||
VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o
|
||||
@@ -362,7 +354,8 @@ GUIHDR = $(MSWIN)\mhaskyn.h $(MSWIN)\mhdlg.h $(MSWIN)\mhfont.h \
|
||||
|
||||
COMCTRL = comctl32.lib
|
||||
|
||||
KEYDLLS = $(GAMEDIR)\nhdefkey.dll $(GAMEDIR)\nh340key.dll $(GAMEDIR)\nhraykey.dll
|
||||
KEYDLLS = $(GAMEDIR)\nhdefkey.dll $(GAMEDIR)\nh340key.dll \
|
||||
$(GAMEDIR)\nhraykey.dll
|
||||
|
||||
TILEUTIL16 = $(UTIL)\tile2bmp.exe
|
||||
TILEBMP16 = $(SRC)\tiles.bmp
|
||||
@@ -399,7 +392,7 @@ PDCLIBOBJS = $(O)addch.o $(O)addchstr.o $(O)addstr.o $(O)attr.o $(O)beep.o
|
||||
PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o \
|
||||
$(O)pdcsetsc.o $(O)pdcutil.o
|
||||
|
||||
PDCLIB = $(O)\pdcurses.lib
|
||||
PDCLIB = $(O)pdcurses.lib
|
||||
|
||||
PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC) /I$(PDCWINCON)
|
||||
|
||||
@@ -452,12 +445,23 @@ DATABASE = $(DAT)\data.base
|
||||
!IF "$(ADD_CURSES)" == "Y"
|
||||
#CURSESDEF=-D"PDC_DLL_BUILD" -D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
|
||||
CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
|
||||
CURSESINCL=..\win\curses
|
||||
!ELSE
|
||||
CURSDEF=
|
||||
CURSESLIB=
|
||||
CURSESINCL=
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF ADD_CURSES
|
||||
INCLDIR= /I..\include /I..\sys\winnt
|
||||
!ELSE
|
||||
INCLDIR= /I..\include /I..\sys\winnt /I$(CURSESINCL)
|
||||
!ENDIF
|
||||
|
||||
#===========================================
|
||||
#---- start of Visual Studio Specific macros
|
||||
#===========================================
|
||||
|
||||
ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \
|
||||
-D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"DLB" -D"_MBCS" \
|
||||
-DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" $(CURSESDEF) \
|
||||
@@ -527,12 +531,6 @@ conlibs = $(baselibs)
|
||||
guilibs = $(winlibs)
|
||||
#
|
||||
|
||||
!IFNDEF ADD_CURSES
|
||||
INCLDIR= /I..\include /I..\sys\winnt
|
||||
!ELSE
|
||||
INCLDIR= /I..\include /I..\sys\winnt /I$(CURSESINCL)
|
||||
!ENDIF
|
||||
|
||||
#==========================================
|
||||
# Util builds
|
||||
#==========================================
|
||||
@@ -552,6 +550,10 @@ DLB = nhdat
|
||||
DLB =
|
||||
! ENDIF
|
||||
|
||||
#==========================================
|
||||
#---- end of Visual Studio Specific macros
|
||||
#==========================================
|
||||
|
||||
#==========================================
|
||||
#================ RULES ==================
|
||||
#==========================================
|
||||
@@ -630,9 +632,6 @@ DLB =
|
||||
{$(WCURSES)}.c{$(OBJ)}.o:
|
||||
@$(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $<
|
||||
|
||||
#{$(WCURSES)}.txt{$(DAT)}.txt:
|
||||
# @copy $< $@
|
||||
|
||||
#==========================================
|
||||
# Rules for files in PDCurses
|
||||
#==========================================
|
||||
@@ -684,11 +683,12 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \
|
||||
if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR)
|
||||
if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt
|
||||
if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
|
||||
@if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space
|
||||
@if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space
|
||||
$(U)makedefs -c
|
||||
-if not exist $(GAMEDIR)\defaults.nh copy fixed_defaults.nh $(GAMEDIR)\defaults.nh
|
||||
-if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh
|
||||
-if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record.
|
||||
@if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space
|
||||
@if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space
|
||||
echo install done > $@
|
||||
|
||||
# copy $(MSWSYS)\winnt.hlp $(GAMEDIR)
|
||||
@@ -753,10 +753,10 @@ $(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico
|
||||
@$(rc) -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc
|
||||
|
||||
|
||||
#==========================================
|
||||
#==========================================================================
|
||||
# The game targets.
|
||||
#==========================================
|
||||
|
||||
#==========================================================================
|
||||
#[VS-start] Visual C
|
||||
# The section for linking the NetHack image looks a little strange at
|
||||
# first, especially if you are used to UNIX makes, or NDMAKE. It is
|
||||
# Microsoft nmake specific, and it gets around the problem of the
|
||||
@@ -778,6 +778,8 @@ $(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico
|
||||
# with ^ as we have done below. Every occurence
|
||||
# of a <tab> in $(ALLOBJ) is replaced by
|
||||
# <+><return><tab>.
|
||||
#[VS-end]
|
||||
#==========================================================================
|
||||
|
||||
GAMEOBJ=$(ALLOBJ:^ =^
|
||||
)
|
||||
@@ -896,20 +898,14 @@ $(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def
|
||||
/PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).map" /DEF:$(O)$(@B).def \
|
||||
/IMPLIB:$(O)$(@B).lib -out:$@ $(O)$(@B).o
|
||||
|
||||
#
|
||||
# Secondary Targets.
|
||||
#
|
||||
|
||||
#==========================================
|
||||
#=========== SECONDARY TARGETS ============
|
||||
#==========================================
|
||||
|
||||
#==========================================
|
||||
# Makedefs Stuff
|
||||
#==========================================
|
||||
$(U)nhsizes.exe: $(O)nhsizes.o
|
||||
@echo Linking $(@:\=/)
|
||||
$(link) $(lflagsBuild) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o
|
||||
|
||||
$(O)nhsizes.o: $(CONFIG_H) nhsizes.c
|
||||
@$(cc) $(cflagsBuild) -Fo$@ nhsizes.c
|
||||
|
||||
$(U)makedefs.exe: $(MAKEOBJS)
|
||||
@echo Linking $(@:\=/)
|
||||
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(MAKEOBJS)
|
||||
@@ -1061,6 +1057,24 @@ $(U)dgncomp.exe: $(DGNCOMPOBJS)
|
||||
)
|
||||
<<
|
||||
|
||||
#=================================================
|
||||
# For a couple of devteam utilities
|
||||
#=================================================
|
||||
|
||||
$(U)nhsizes.exe: $(O)nhsizes.o
|
||||
@echo Linking $(@:\=/)
|
||||
$(link) $(lflagsBuild) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o
|
||||
|
||||
$(U)nhsizes2.exe: $(O)nhsizes2.o
|
||||
@echo Linking $(@:\=/)
|
||||
$(link) $(lflagsBuild) -out:$@ $(O)nhsizes2.o $(O)panic.o $(O)alloc.o
|
||||
|
||||
$(O)nhsizes.o: $(CONFIG_H) nhsizes.c
|
||||
@$(cc) $(cflagsBuild) -Fo$@ nhsizes.c
|
||||
|
||||
$(O)nhsizes2.o: $(CONFIG_H) nhsizes2.c
|
||||
@$(cc) $(cflagsBuild) -Fo$@ nhsizes2.c
|
||||
|
||||
#=================================================
|
||||
# Create directory for holding object files
|
||||
#=================================================
|
||||
@@ -1070,34 +1084,6 @@ $(O)obj.tag:
|
||||
@if not exist $(OBJ)\*.* mkdir $(OBJ)
|
||||
@echo directory created >$@
|
||||
|
||||
#==========================================
|
||||
# Notify of any CL environment variables
|
||||
# in effect since they change the compiler
|
||||
# options.
|
||||
#==========================================
|
||||
|
||||
$(O)envchk.tag: $(O)obj.tag
|
||||
! IF "$(TARGET_CPU)"=="x64"
|
||||
@echo Windows x64 64-bit target build
|
||||
! ELSE
|
||||
@echo Windows x86 32-bit target build
|
||||
! ENDIF
|
||||
!IFDEF TTYOBJ
|
||||
@echo tty window support included
|
||||
! IF "$(ADD_CURSES)"=="Y"
|
||||
@echo curses window support also included
|
||||
! ENDIF
|
||||
!ENDIF
|
||||
! IF "$(CL)"!=""
|
||||
# @echo Warning, the CL Environment variable is defined:
|
||||
# @echo CL=$(CL)
|
||||
! ENDIF
|
||||
echo envchk >$@
|
||||
|
||||
#==========================================
|
||||
#=========== SECONDARY TARGETS ============
|
||||
#==========================================
|
||||
|
||||
#==========================================
|
||||
# DLB utility and nhdat file creation
|
||||
#==========================================
|
||||
@@ -1259,12 +1245,36 @@ $(O)til2bm32.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h
|
||||
@$(cc) $(cflagsBuild) -I$(WSHR) /DPACKED_FILE /DTILE_X=32 /DTILE_Y=32 /Fo$@ $(WSHR)\tile2bmp.c
|
||||
|
||||
#==========================================
|
||||
# PDCurses
|
||||
# PDCurses Library
|
||||
#==========================================
|
||||
|
||||
$(O)\pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS)
|
||||
$(O)pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS)
|
||||
lib -nologo /out:$@ $(PDCLIBOBJS) $(PDCOBJS)
|
||||
|
||||
#==========================================
|
||||
# Notify of any CL environment variables
|
||||
# in effect since they change the compiler
|
||||
# options.
|
||||
#==========================================
|
||||
|
||||
$(O)envchk.tag: $(O)obj.tag
|
||||
! IF "$(TARGET_CPU)"=="x64"
|
||||
@echo Windows x64 64-bit target build
|
||||
! ELSE
|
||||
@echo Windows x86 32-bit target build
|
||||
! ENDIF
|
||||
!IFDEF TTYOBJ
|
||||
@echo tty window support included
|
||||
! IF "$(ADD_CURSES)"=="Y"
|
||||
@echo curses window support also included
|
||||
! ENDIF
|
||||
!ENDIF
|
||||
! IF "$(CL)"!=""
|
||||
# @echo Warning, the CL Environment variable is defined:
|
||||
# @echo CL=$(CL)
|
||||
! ENDIF
|
||||
echo envchk >$@
|
||||
|
||||
#==========================================
|
||||
# Housekeeping
|
||||
#==========================================
|
||||
@@ -1470,6 +1480,8 @@ $(O)winhack.o: $(HACK_H) $(MSWIN)\winhack.c
|
||||
$(O)ttystub.o: $(HACK_H) $(MSWSYS)\stubs.c
|
||||
@$(cc) $(cflagsBuild) -DTTYSTUB -Fo$@ $(MSWSYS)\stubs.c
|
||||
|
||||
$(O)tile.o: $(SRC)\tile.c $(HACK_H)
|
||||
|
||||
#
|
||||
# util dependencies
|
||||
#
|
||||
@@ -1483,18 +1495,21 @@ $(O)panic.o: $(U)panic.c $(CONFIG_H)
|
||||
|
||||
(O)cppregex.o: $(O)cppregex.cpp $(HACK_H)
|
||||
@$(CC) $(cflagsBuild) -Fo$@ ..\sys\share\cppregex.cpp
|
||||
|
||||
#
|
||||
# curses window port dependencies
|
||||
#
|
||||
$(O)\cursdial.o: $(WCURSES)\cursdial.c $(WCURSES)\cursdial.h $(INCL)\wincurs.h
|
||||
$(O)\cursinit.c: $(WCURSES)\cursinit.c $(WCURSES)\cursinit.h $(INCL)\wincurs.h
|
||||
$(O)\cursinvt.c: $(WCURSES)\cursinvt.c $(WCURSES)\cursinvt.h $(INCL)\wincurs.h
|
||||
$(O)\cursmain.c: $(WCURSES)\cursmain.c $(WCURSES)\cursmain.h $(INCL)\wincurs.h
|
||||
$(O)\cursmesg.c: $(WCURSES)\cursmesg.c $(WCURSES)\cursmesg.h $(INCL)\wincurs.h
|
||||
$(O)\cursmisc.c: $(WCURSES)\cursmisc.c $(WCURSES)\cursmisc.h $(INCL)\wincurs.h
|
||||
$(O)\cursstat.c: $(WCURSES)\cursstat.c $(WCURSES)\cursstat.h $(INCL)\wincurs.h
|
||||
$(O)\curswins.c: $(WCURSES)\curswins.c $(WCURSES)\curswins.h $(INCL)\wincurs.h
|
||||
# Other dependencies needed by some ports
|
||||
#
|
||||
|
||||
# curses window port dependencies
|
||||
|
||||
$(O)cursdial.o: $(WCURSES)\cursdial.c $(WCURSES)\cursdial.h $(INCL)\wincurs.h
|
||||
$(O)cursinit.c: $(WCURSES)\cursinit.c $(WCURSES)\cursinit.h $(INCL)\wincurs.h
|
||||
$(O)cursinvt.c: $(WCURSES)\cursinvt.c $(WCURSES)\cursinvt.h $(INCL)\wincurs.h
|
||||
$(O)cursmain.c: $(WCURSES)\cursmain.c $(WCURSES)\cursmain.h $(INCL)\wincurs.h
|
||||
$(O)cursmesg.c: $(WCURSES)\cursmesg.c $(WCURSES)\cursmesg.h $(INCL)\wincurs.h
|
||||
$(O)cursmisc.c: $(WCURSES)\cursmisc.c $(WCURSES)\cursmisc.h $(INCL)\wincurs.h
|
||||
$(O)cursstat.c: $(WCURSES)\cursstat.c $(WCURSES)\cursstat.h $(INCL)\wincurs.h
|
||||
$(O)curswins.c: $(WCURSES)\curswins.c $(WCURSES)\curswins.h $(INCL)\wincurs.h
|
||||
|
||||
#
|
||||
# The rest are stolen from sys/unix/Makefile.src,
|
||||
# with the following changes:
|
||||
@@ -1567,7 +1582,6 @@ $(O)wintext.o: ..\win\X11\wintext.c $(HACK_H) $(INCL)\winX.h $(INCL)\xwindow.h
|
||||
@$(CC) $(cflagsBuild) -Fo$@ ..\win\X11\wintext.c
|
||||
$(O)winval.o: ..\win\X11\winval.c $(HACK_H) $(INCL)\winX.h
|
||||
@$(CC) $(cflagsBuild) -Fo$@ ..\win\X11\winval.c
|
||||
$(O)tile.o: $(SRC)\tile.c $(HACK_H)
|
||||
$(O)gnaskstr.o: ..\win\gnome\gnaskstr.c ..\win\gnome\gnaskstr.h \
|
||||
..\win\gnome\gnmain.h
|
||||
@$(CC) $(cflagsBuild) $(GNOMEINC) -Fo$@ ..\win\gnome\gnaskstr.c
|
||||
|
||||
@@ -23,6 +23,9 @@ OPTIONS=symset:IBMGraphics_2,roguesymset:RogueEpyx
|
||||
# for use by blind NetHack players
|
||||
#OPTIONS=symset:NHAccess,roguesymset:NHAccess
|
||||
|
||||
# Optional curses port interface
|
||||
#OPTIONS=windowtype:curses
|
||||
#
|
||||
# Keyboard handling
|
||||
# Different keyboard handlers can be loaded.
|
||||
# Default is nhdefkey.dll but you can override that.
|
||||
@@ -80,7 +83,7 @@ MENUCOLOR=" cursed .* (being worn)" = orange&underline
|
||||
#
|
||||
# number_pad option can have an optional value of 0 (off), 1 (on),
|
||||
# or 2(on,legacy-mode) which causes 5='g', alt-5='G', alt-0='I'
|
||||
OPTIONS=time,noshowexp,number_pad:2,lit_corridor
|
||||
OPTIONS=time,noshowexp,number_pad:2,lit_corridor,mouse_support:1
|
||||
|
||||
# Make commands that ask for an inventory item pop up a menu
|
||||
OPTIONS=force_invmenu
|
||||
|
||||
@@ -87,6 +87,7 @@ static void NDECL(restore_original_console_font);
|
||||
/* Win32 Screen buffer,coordinate,console I/O information */
|
||||
COORD ntcoord;
|
||||
INPUT_RECORD ir;
|
||||
static boolean orig_QuickEdit;
|
||||
|
||||
/* Support for changing console font if existing glyph widths are too wide */
|
||||
|
||||
@@ -311,8 +312,14 @@ const char *s;
|
||||
end_screen();
|
||||
if (s)
|
||||
raw_print(s);
|
||||
|
||||
restore_original_console_font();
|
||||
if (orig_QuickEdit) {
|
||||
DWORD cmode;
|
||||
|
||||
GetConsoleMode(console.hConIn, &cmode);
|
||||
cmode |= (ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS);
|
||||
SetConsoleMode(console.hConIn, cmode);
|
||||
}
|
||||
}
|
||||
|
||||
/* called by init_nhwindows() and resume_nhwindows() */
|
||||
@@ -864,12 +871,30 @@ standoutend()
|
||||
void
|
||||
toggle_mouse_support()
|
||||
{
|
||||
static int qeinit = 0;
|
||||
DWORD cmode;
|
||||
|
||||
GetConsoleMode(console.hConIn, &cmode);
|
||||
if (iflags.wc_mouse_support)
|
||||
cmode |= ENABLE_MOUSE_INPUT;
|
||||
else
|
||||
cmode &= ~ENABLE_MOUSE_INPUT;
|
||||
if (!qeinit) {
|
||||
qeinit = 1;
|
||||
orig_QuickEdit = ((cmode & ENABLE_QUICK_EDIT_MODE) != 0);
|
||||
}
|
||||
switch(iflags.wc_mouse_support) {
|
||||
case 2:
|
||||
cmode |= ENABLE_MOUSE_INPUT;
|
||||
break;
|
||||
case 1:
|
||||
cmode |= ENABLE_MOUSE_INPUT;
|
||||
cmode &= ~ENABLE_QUICK_EDIT_MODE;
|
||||
cmode |= ENABLE_EXTENDED_FLAGS;
|
||||
break;
|
||||
case 0:
|
||||
/*FALLTHRU*/
|
||||
default:
|
||||
cmode &= ~ENABLE_MOUSE_INPUT;
|
||||
if (orig_QuickEdit)
|
||||
cmode |= (ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS);
|
||||
}
|
||||
SetConsoleMode(console.hConIn, cmode);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user