Added mechanism to change default directory

This commit is contained in:
ceriel 1989-10-24 16:54:55 +00:00
parent 88a316478d
commit 80cb794116
2 changed files with 10 additions and 3 deletions

View file

@ -14,7 +14,9 @@ GFILES =$(GENGFILES) $(GF)
LLGENOPTIONS = LLGENOPTIONS =
PROFILE = PROFILE =
M2COMPILER = m2 M2COMPILER = m2
CFLAGS = -O $(PROFILE) $(INCLUDES) -DSTATIC= -DM2COMPILER=\"$(M2COMPILER)\" DEFDIR = lib/m2
HOMEDIR =
CFLAGS = -O $(PROFILE) $(INCLUDES) -DSTATIC= -DM2COMPILER=\"$(M2COMPILER)\" -DDEF_DIR=$(DEFDIR) $(HOMEDIR)
LINTFLAGS = -DSTATIC= -DNORCSID LINTFLAGS = -DSTATIC= -DNORCSID
MALLOC = $(LIBDIR)/malloc.o MALLOC = $(LIBDIR)/malloc.o
LDFLAGS = -i $(PROFILE) LDFLAGS = -i $(PROFILE)
@ -34,7 +36,7 @@ HFILES =$(GENH) $(HSRC)
GENFILES = $(GENGFILES) $(GENC) $(GENH) GENFILES = $(GENGFILES) $(GENC) $(GENH)
all: Cfiles all: Cfiles
make "EMHOME="$(EMHOME) "M2COMPILER="$(M2COMPILER) m2mm make "EMHOME="$(EMHOME) "DEFDIR="$(DEFDIR) "HOMEDIR="$(HOMEDIR) "M2COMPILER="$(M2COMPILER) m2mm
install: all install: all
cp m2mm $(EMHOME)/bin cp m2mm $(EMHOME)/bin

View file

@ -13,6 +13,10 @@
#include <alloc.h> #include <alloc.h>
#include "main.h" #include "main.h"
#ifdef OTHER_HOME
#undef EM_DIR
#define EM_DIR OTHER_HOME
#endif
static char lib_dir[128] = EM_DIR; static char lib_dir[128] = EM_DIR;
static struct liblist { static struct liblist {
@ -41,7 +45,8 @@ init_lib()
{ {
extern char *strcat(); extern char *strcat();
strcat(lib_dir, "/lib/m2"); strcat(lib_dir, "/");
strcat(lib_dir, DEF_DIR);
AddLibDir(lib_dir); AddLibDir(lib_dir);
} }