$(CC) -c.m $(CFLAGS) $<
all:\
-classdefs.h pop_push.h wordlen.h alloc.o cset.o debug.o files.o go.o\
+classdefs.h pop_push.h alloc.o cset.o debug.o files.o go.o\
global.o lset.o map.o parser.o get.o put.o aux.o stack_chg.o locals.o\
init_glob.o
distr: pop_push.h
em_files:\
-classdefs.h pop_push.h wordlen.h alloc.m cset.m debug.m\
+classdefs.h pop_push.h alloc.m cset.m debug.m\
files.m go.m global.m lset.m map.m parser.m get.m put.m aux.m stack_chg.m\
locals.m init_glob.m
$(EMHOME)/etc/em_table pop_push.awk
awk -f pop_push.awk < $(EMHOME)/etc/em_table > pop_push.h
-wordlen.h: makewordlen
- makewordlen > wordlen.h
- rm makewordlen
-
-makewordlen: makewlen.c
- $(CC) -o makewordlen makewlen.c
-
show: \
show.c
$(CC) -o show show.c $(EMLIB)/em_data.a
@echo "cleaned. Type 'make oclean' instead."
oclean:
- rm -f makeclassdef classdefs.h makewordlen wordlen.h *.o Out out nohup.out *.m
+ rm -f makeclassdef classdefs.h *.o Out out nohup.out *.m
lint:
lint $(LINTFLAGS) $(CPPFLAGS) $(CFILES)
/* number of bits in a byte */
#define BYTELENGTH 8
-/* number of bits in a word, defined in automatically generated file */
-#include "../share/wordlen.h"
-
#if BYTELENGTH==8
#define DIVBL(a) ((a) >> 3)
#define MODBL(a) ((a) & 07)
#define MODBL(a) (a%BYTELENGTH)
#endif
-#if WORDLENGTH==16
-#define DIVWL(a) ((a) >> 4)
-#define MODWL(a) ((a) & 017)
-#else
-#if WORDLENGTH==32
-#define DIVWL(a) ((a) >> 5)
-#define MODWL(a) ((a) & 037)
-#else
-#define DIVWL(a) (a/WORDLENGTH)
-#define MODWL(a) (a%WORDLENGTH)
-#endif
-#endif
-
+#define WORDLENGTH (sizeof(int)*BYTELENGTH)
+
+#define DIVWL(a) (WORDLENGTH==16 ? \
+ ((a)>>4) : \
+ (WORDLENGTH==32 ? \
+ ((a)>>5) : \
+ ((a)/(8*sizeof(int)))))
+#define MODWL(a) (WORDLENGTH==16 ? \
+ ((a)&017) : \
+ (WORDLENGTH==32 ? \
+ ((a)&037) : \
+ ((a)%(8*sizeof(int)))))
#define UNKNOWN_SIZE (-1)