set -e
-if [ -z "$1" ]; then
- echo "usage: $0 <out_dir>"
- exit 1
-fi
-
-rm -rf $1
-mkdir $1
-cp gp2xmenu/gp2xmenu $1/
-cp -r gp2xmenu/gp2xmenu_data $1/
-cp loader/ginge_dyn $1/
-cp loader/ginge_sloader $1/
-cp readme.txt $1/
+rm -rf ${out}
+mkdir ${out}
+cp gp2xmenu/gp2xmenu${tag} ${out}/gp2xmenu
+cp -r gp2xmenu/gp2xmenu_data ${out}/
+cp prep/ginge_prep${tag} ${out}/ginge_prep
+cp loader/ginge_dyn${tag} ${out}/ginge_dyn
+cp loader/ginge_sloader${tag} ${out}/ginge_sloader
+cp readme.txt ${out}/
ifdef PND
CFLAGS += -DPND
OBJ += host_pnd.o
+TAG = _pnd
endif
ifdef WIZ
CFLAGS += -DWIZ
OBJ += host_wiz.o wiz_video_arm.o
+TAG = _wiz
endif
vpath %.c = ../common/
vpath %.s = ../common/
-TARGET_S = ginge_sloader
-TARGET_D = ginge_dyn
+TARGET_S = ginge_sloader$(TAG)
+TARGET_D = ginge_dyn$(TAG)
OBJ += emu.o host_fb.o cmn.o
OBJ_S += $(OBJ) loader.o loader_$(ARCH).o patches.o
all: $(TARGET_S) $(TARGET_D)
$(TARGET_S): LDFLAGS += -Wl,-T script_$(ARCH).lds
-$(TARGET_D): LDFLAGS += -ldl -Wl,--version-script=$(TARGET_D).symver
+$(TARGET_D): LDFLAGS += -ldl -Wl,--version-script=ginge_dyn.symver
$(TARGET_S): $(OBJ_S)
$(CC) -o $@ $^ -static $(LDFLAGS)
set -e
-out=out_pnd
+export out=out_pnd
+export tag=_pnd
-dist/make_cmn.sh ${out}
+dist/make_cmn.sh
mkdir -p ${out}/tools
cp dist/ginge.sh ${out}/
cp dist/ginge_dyn_eabi.sh ${out}/ginge_dyn.sh
-cp prep/ginge_prep_pnd ${out}/ginge_prep
cp tools/cramfsck_eabi ${out}/tools/cramfsck
cp -r lib ${out}/
set -e
-out=out_wiz
+export out=out_wiz
+export tag=_wiz
-dist/make_cmn.sh ${out}
+dist/make_cmn.sh
mkdir -p ${out}/tools ${out}/lib
cp dist/ginge.gpe ${out}/
cp dist/ginge32.png ${out}/ginge.png
cp dist/ginge_dyn_oabi.sh ${out}/ginge_dyn.sh
-cp prep/ginge_prep_wiz ${out}/ginge_prep
cp lib/libSDL-1.2.so.0.7.0 ${out}/lib/libSDL-1.2.so.0
cp tools/cramfsck_oabi ${out}/tools/cramfsck
cp tools/warm_2.6.24.ko ${out}/tools/
dd if=/dev/zero of=${out}/swapfile bs=1M count=16
cd ${out}
+rm ../ginge_wiz.zip 2> /dev/null || true
zip -9r ../ginge_wiz.zip *