MOUNT_POINT = /media/sda3 BASE_DIR = /home/nano LOCAL_BASE = $(MOUNT_POINT)$(BASE_DIR) NAME = nano RELEASEDIR = $(NAME) OBJS = main.o platform.o music.o tools.o sprite.o triangle.o geometry.o molecules.o fade.o OBJS += scenemgr.o demo.o OBJS += intro.o planet.o landscape.o wobble.o tunnel.o cells.o greetings.o \ heightfield.o wilson.o atoms.o collide.o final.o ifeq ($(TARGET),) TARGET = debug endif ifeq ($(TARGET),debug) PREFIX = SUFFIX = -debug CFLAGS = -Wall -g -DSDL -DSDL_MUSIC LDFLAGS = -lSDL -lm -lpthread OBJS += platform_sdl.o endif ifeq ($(TARGET),generic) PREFIX = SUFFIX = -generic CFLAGS = -Wall -DSDL -DSDL_MUSIC -O2 LDFLAGS = -lSDL -lm OBJS += platform_sdl.o endif ifeq ($(TARGET),linux) PREFIX = SUFFIX = -linux-x86 CFLAGS = -Wall -DSDL -DSDL_MUSIC -O2 LDFLAGS = -lSDL -lm -lpthread OBJS += platform_sdl.o endif ifeq ($(TARGET),win32) PREFIX = SUFFIX = -win32 CFLAGS = -Wall -DSDL -DSDL_MUSIC -DWIN32 -DNO_SUMMARY -O2 LDFLAGS = -lSDL -lm -Wl,--subsystem=windows OBJS += platform_sdl.o endif ifeq ($(TARGET),render) PREFIX = SUFFIX = -render CFLAGS = -Wall -DRENDER -g LDFLAGS = -lm -g OBJS += platform_render.o endif ifeq ($(TARGET),gp2x) PREFIX = gp2x- SUFFIX = .gpe CFLAGS = -Wall -O2 -DGP2X -DSDL_MUSIC -I/usr/local/gp2xdev/include LDFLAGS = -lm -L/usr/local/gp2xdev/lib -lpthread -lSDL -static OBJS += platform_gp2x.o endif ifeq ($(TARGET),ipod) PREFIX = arm-elf- SUFFIX = -ipod CFLAGS = -Wall -O2 -DIPOD -DOSS LDFLAGS = -lm -elf2flt OBJS += platform_ipod.o endif ifneq ($(DEBUG),) CFLAGS += -D_DEBUG endif CC = $(PREFIX)gcc LD = $(PREFIX)gcc BINARY = $(NAME)$(SUFFIX) all: data $(BINARY) test: all ./$(BINARY) -1 data: make -C data $(BINARY): $(OBJS) $(LD) -o $(BINARY) $(OBJS) $(LDFLAGS) clean: rm -f *.o $(BINARY) *.gdb distclean: clean rm -f $(NAME)-* $(NAME).tgz $(NAME)-src.tgz rm -rf $(RELEASEDIR) make -C data clean install: mkdir -p $(LOCAL_BASE) cp $(BINARY) $(FILES) $(LOCAL_BASE) make -C data install rm -f $(MOUNT_POINT)/sbin/d echo -e "#!/bin/sh\ncd $(BASE_DIR)\n./$(BINARY)" >$(MOUNT_POINT)/sbin/d chmod +x $(MOUNT_POINT)/sbin/d reinstall: make TARGET=ipod clean all sudo mount /dev/sda3 /media/sda3 sudo make TARGET=ipod install sudo umount /media/sda3 sudo eject /dev/sda source: $(NAME)-src.tgz $(NAME)-src.tgz: distclean tar czvf $@ data/ *.c *.h \ Makefile do_render.sh init $(NAME).nfo readme.txt release: rm -rf $(RELEASEDIR)/ mkdir -p $(RELEASEDIR)/data/ chmod +x $(NAME)-win32.exe || true cp $(NAME)-win32.exe SDL.dll readme.txt $(NAME).nfo $(RELEASEDIR)/ || true make TARGET=ipod clean all cp $(NAME)-ipod $(RELEASEDIR)/ make TARGET=gp2x clean all gp2x-strip $(NAME).gpe cp $(NAME).gpe $(RELEASEDIR)/ make TARGET=linux clean all strip $(NAME)-linux-x86 cp $(NAME)-linux-x86 $(RELEASEDIR)/ make -C data RELEASEDIR=$(RELEASEDIR) release rm -f $(RELEASEDIR).tgz tar czf $(RELEASEDIR).tgz $(RELEASEDIR)/ .PHONY: all data clean distclean install reinstall release source