Skip to content

Commit 1f8b413

Browse files
committed
Don't try to copy into firmware directory unless make dist was called
1 parent f882d38 commit 1f8b413

File tree

3 files changed

+41
-21
lines changed

3 files changed

+41
-21
lines changed

Makefile.adam

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ INC_FLAGS := $(addprefix -I,$(INC_DIRS))
2525

2626
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
2727
$(CC) $(LDFLAGS) $(OBJS)
28-
cp autorun.ddp ../fujinet-platformio/data/webui/device_specific/BUILD_ADAM/
28+
29+
.PHONY: dist autorun clean
30+
31+
dist: $(TARGET_EXEC)
32+
cp $< ../fujinet-platformio/data/webui/device_specific/BUILD_ADAM/
33+
34+
# Just here so all platforms can have a `make autorun`
35+
autorun: $(TARGET_EXEC)
2936

3037
# c source
3138
$(BUILD_DIR)/%.c.o: %.c
@@ -37,8 +44,6 @@ $(BUILD_DIR)/%.asm.o: %.asm
3744
$(MKDIR_P) $(dir $@)
3845
$(AS) $(ASFLAGS) -c $< -o $@
3946

40-
.PHONY: clean
41-
4247
clean:
4348
$(RM) -r autorun* $(BUILD_DIR)
4449

Makefile.apple2

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ FUJINET_LIB_VERSION_DIR = $(FUJINET_LIB)/$(FUJINET_LIB_VERSION)-$(TARGETS)
1717
# Name of the final, single-file executable.
1818
# Default: name of the current dir with target name appended
1919
PROGRAM := config
20+
DISK := dist.apple2/autorun.po
2021

2122
# Path(s) to additional libraries required for linking the program
2223
# Use only if you don't want to place copies of the libraries in SRCDIR
@@ -256,7 +257,7 @@ ASFLAGS += --asm-include-dir src/$(TARGETLIST)/asminc --asm-include-dir $(FUJINE
256257
CFLAGS += --include-dir $(FUJINET_LIB_VERSION_DIR) -DUSING_FUJINET_LIB
257258

258259
.SUFFIXES:
259-
.PHONY: all test clean get_fujinet_lib zap love
260+
.PHONY: all test clean get_fujinet_lib zap love dist autorun
260261

261262
all: get_fujinet_lib $(PROGRAM)
262263

@@ -344,24 +345,29 @@ test: $(PROGRAM)
344345
$(EMUCMD) $<
345346
$(POSTEMUCMD)
346347

347-
dist: $(PROGRAM)
348-
cp dist.apple2/bootable.po dist.apple2/dist.po
349-
./dist.apple2/add-file.sh dist.apple2/dist.po config config.system
348+
$(DISK): $(PROGRAM)
349+
cp dist.apple2/bootable.po $@
350+
./dist.apple2/add-file.sh $@ config config.system
351+
352+
dist: $(DISK)
350353
@( \
351-
echo "Attempting to copy autorun.po to firmware folder outside of project" ; \
354+
echo "Attempting to copy $(DISK) to firmware folder outside of project" ; \
352355
if [ -d ../fujinet-firmware/ ] ; then \
353356
echo "Copying into ../fujinet-firmware" ; \
354-
cp dist.apple2/dist.po ../fujinet-firmware/data/webui/device_specific/BUILD_APPLE/autorun.po ; \
357+
cp dist.apple2/dist.po ../fujinet-firmware/data/webui/device_specific/BUILD_APPLE/$(DISK) ; \
355358
elif [ -d ../fujinet-platformio/ ] ; then \
356359
echo "Copying into ../fujinet-platformio (NOTE: please consider renaming to updated fujinet-firmware name)" ; \
357-
cp dist.apple2/dist.po ../fujinet-platformio/data/webui/device_specific/BUILD_APPLE/autorun.po ; \
360+
cp dist.apple2/dist.po ../fujinet-platformio/data/webui/device_specific/BUILD_APPLE/$(DISK) ; \
358361
else \
359-
echo "ERROR: Could not find fujinet firmware folder to copy autorun.po to." ; \
362+
echo "ERROR: Could not find fujinet firmware folder to copy $(DISK) to." ; \
360363
echo "Tried ../fujinet-firmware, and ../fujinet-platformio" ; \
361364
exit 1 ; \
362365
fi ; \
363366
)
364367

368+
# Just here so all platforms can have a `make autorun`
369+
autorun: $(DISK)
370+
365371
gendebug: $(PROGRAM)
366372
@echo "Generating debug.scr script for AppleWin"
367373
@echo 'echo "Loading symbols"' > debug.scr

Makefile.coco

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,26 @@ AS=lwasm
55
CP=cp
66
ECHO=echo
77
FIRMWARE_DIR="../fujinet-firmware"
8+
TARGET_EXEC=config.bin
9+
DISK=autorun.dsk
810

9-
config.bin: check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
10-
$(CC) -o config.bin check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
11-
$(RM) autorun.dsk
12-
decb dskini autorun.dsk
13-
decb copy -t -0 dist.coco/autoexec.bas autorun.dsk,AUTOEXEC.BAS
14-
writecocofile autorun.dsk config.bin
15-
$(CP) autorun.dsk $(FIRMWARE_DIR)/data/webui/device_specific/BUILD_COCO/
16-
# $(CP) autorun.dsk ~/tnfs/
11+
$(TARGET_EXEC): check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
12+
$(CC) -o $@ check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
13+
14+
$(DISK): $(TARGET_EXEC)
15+
$(RM) $(DISK)
16+
decb dskini $(DISK)
17+
decb copy -t -0 dist.coco/autoexec.bas $(DISK),AUTOEXEC.BAS
18+
writecocofile $(DISK) $<
19+
20+
dist: $(DISK)
21+
$(CP) $< $(FIRMWARE_DIR)/data/webui/device_specific/BUILD_COCO/
1722
$(ECHO) Now, Do a Upload Filesystem task.
1823

24+
.PHONY: autorun
25+
# Just here so all platforms can have a `make autorun`
26+
autorun: $(DISK)
27+
1928
pause.o: src/coco/pause.c
2029
$(CC) -c src/coco/pause.c
2130

@@ -73,5 +82,5 @@ screen.o: src/coco/screen.c
7382
clean:
7483
$(RM) *.o
7584
$(RM) coco/*.o
76-
$(RM) config.bin
77-
$(RM) autorun.dsk
85+
$(RM) $(TARGET_EXEC)
86+
$(RM) $(DISK)

0 commit comments

Comments
 (0)