#
#NO_MEMMOVE = yes
+# Uncomment this if you want to disable the compilation of Blorb support.
+#
+#NO_BLORB = yes
+
#########################################################################
# This section is where Frotz is actually built.
# Under normal circumstances, nothing in this section should be changed.
DUMB_DIR = $(SRCDIR)/dumb
DUMB_LIB = $(DUMB_DIR)/frotz_dumb.a
+ifndef NO_BLORB
BLORB_DIR = $(SRCDIR)/blorb
BLORB_LIB = $(BLORB_DIR)/blorblib.a
+endif
SDL_DIR = $(SRCDIR)/sdl
SDL_LIB = $(SDL_DIR)/frotz_sdl.a
endif
ifdef NO_MEMMOVE
@echo "#define NO_MEMMOVE" >> $@
+endif
+ifdef NO_BLORB
+ @echo "#define NO_BLORB" >> $@
endif
@echo "#endif /* COMMON_DEFINES_H */" >> $@
+
curses_defines: $(CURSES_DEFINES)
$(CURSES_DEFINES):
@echo "** Generating $@"
.DELETE_ON_ERROR:
$(TARGET): $(OBJECTS)
+ifndef NO_BLORB
$(AR) $(ARFLAGS) $@ $?
$(RANLIB) $@
@echo "** Done with dumb interface."
+endif
clean:
rm -f $(TARGET) $(OBJECTS)
%.o: %.c
+ifndef NO_BLORB
$(CC) $(CFLAGS) -fPIC -fpic -o $@ -c $<
+endif
* Or visit http://www.fsf.org/
*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dumb_frotz.h"
#include "dumb_blorb.h"
+/* Don't build any of this if we don't want Blorb support. */
+#ifndef NO_BLORB
+
f_setup_t f_setup;
FILE *blorb_fp;
return 1;
}
+
+#endif /* NO_BLORB */
*
*/
+#ifndef NO_BLORB
+
#include "../blorb/blorb.h"
#include "../blorb/blorblow.h"
bb_err_t dumb_blorb_init(char *);
void dumb_blorb_stop(void);
+
+#endif /* NO_BLORB */
{
FILE *fp;
+#ifndef NO_BLORB
switch (dumb_blorb_init(f_setup.story_file)) {
case bb_err_NoBlorb:
// printf("No blorb file found.\n\n");
/* Is this a Blorb file containing Zcode? */
if (f_setup.exec_in_blorb)
fseek(fp, blorb_res.data.startpos, SEEK_SET);
+#else
+ fp = fopen(f_setup.story_file, "rb");
+#endif /* NO_BLORB */
return fp;
}