DEBUG = FALSE CC = nspire-gcc LD = nspire-ld-bflt CFLAGS = -Wall -W -marm -DUSE_NSDL_FONT LDFLAGS = -lfdm -lSDL ifeq ($(DEBUG),FALSE) CFLAGS += -Os else CFLAGS += -O0 -g LDFLAGS += --debug endif DISTDIR = . vpath %.tns $(DISTDIR) OBJS = \ tworld.o series.o play.o encoding.o solution.o res.o lxlogic.o mslogic.o \ unslist.o help.o score.o random.o cmdline.o fileio.o err.o sscanf.o liboshw.a # # The main target # all: tworld.tns mklynxcc.tns # # Binaries # tworld.tns: $(OBJS) @mkdir -p $(DISTDIR) $(LD) $^ -o $(DISTDIR)/$@ $(LDFLAGS) ifeq ($(DEBUG),FALSE) @rm -f $(DISTDIR)/$@.gdb endif mklynxcc.tns: mklynxcc.o @mkdir -p $(DISTDIR) $(LD) $^ -o $(DISTDIR)/$@ $(LDFLAGS) ifeq ($(DEBUG),FALSE) @rm -f $(DISTDIR)/$@.gdb endif # # Object files # tworld.o : tworld.c defs.h gen.h err.h series.h res.h play.h score.h \ solution.h fileio.h help.h oshw.h cmdline.h ver.h series.o : series.c series.h defs.h gen.h err.h fileio.h solution.h play.o : play.c play.h defs.h gen.h err.h state.h random.h oshw.h res.h \ logic.h solution.h fileio.h encoding.o : encoding.c encoding.h defs.h gen.h err.h state.h solution.o : solution.c solution.h defs.h gen.h err.h fileio.h res.o : res.c res.h defs.h gen.h fileio.h err.h oshw.h lxlogic.o : lxlogic.c logic.h defs.h gen.h err.h state.h random.h mslogic.o : mslogic.c logic.h defs.h gen.h err.h state.h random.h unslist.o : unslist.c unslist.h gen.h err.h fileio.h help.o : help.c help.h defs.h gen.h state.h oshw.h ver.h comptime.h score.o : score.c score.h defs.h gen.h err.h play.h random.o : random.c random.h defs.h gen.h cmdline.o : cmdline.c cmdline.h gen.h fileio.o : fileio.c fileio.h defs.h gen.h err.h err.o : err.c oshw.h err.h sscanf.o : sscanf.c sscanf.h mklynxcc.o : mklynxcc.c # # Generated files # comptime.h: echo \#define COMPILE_TIME \"`date '+%Y %b %e %T %Z'`\" > comptime.h # # Libraries # liboshw.a: oshw.h defs.h gen.h state.h err.h oshw/*.c oshw/*.h ifeq ($(DEBUG),FALSE) (cd oshw && $(MAKE)) else (cd oshw && $(MAKE) DEBUG=TRUE) endif # # Other # clean: rm -f $(OBJS) mklynxcc.o $(DISTDIR)/tworld.tns $(DISTDIR)/mklynxcc.tns \ $(DISTDIR)/tworld.tns.gdb $(DISTDIR)/mklynxcc.tns.gdb comptime.h (cd oshw && $(MAKE) clean) .PHONY: all clean