Build output goes into the bin folder. (#936)

Co-authored-by: Steve Robb <softnfuzzyrobb@gmail.com>
This commit is contained in:
Steve Robb
2025-01-17 06:30:05 +00:00
committed by GitHub
parent 80ae5b4aca
commit 74eb4be7da
2 changed files with 21 additions and 18 deletions

View File

@@ -26,6 +26,8 @@ INCLUDE += -I./lib/libchdr/include
INCLUDE += -I./lib/bluetooth
INCLUDE += -I./lib/serial_server/library
BUILDDIR = bin
PRJ = MiSTer
C_SRC = $(wildcard *.c) \
$(wildcard ./lib/miniz/*.c) \
@@ -34,63 +36,63 @@ C_SRC = $(wildcard *.c) \
$(wildcard ./lib/zstd/lib/common/*.c) \
$(wildcard ./lib/zstd/lib/decompress/*.c) \
$(wildcard ./lib/libchdr/*.c) \
lib/libco/arm.c
lib/libco/arm.c
CPP_SRC = $(wildcard *.cpp) \
$(wildcard ./lib/serial_server/library/*.cpp) \
$(wildcard ./support/*/*.cpp)
$(wildcard ./support/*/*.cpp)
IMG = $(wildcard *.png)
IMLIB2_LIB = -Llib/imlib2 -lfreetype -lbz2 -lpng16 -lz -lImlib2
OBJ = $(C_SRC:.c=.c.o) $(CPP_SRC:.cpp=.cpp.o) $(IMG:.png=.png.o)
DEP = $(C_SRC:.c=.c.d) $(CPP_SRC:.cpp=.cpp.d)
OBJ = $(C_SRC:%.c=$(BUILDDIR)/%.c.o) $(CPP_SRC:%.cpp=$(BUILDDIR)/%.cpp.o) $(IMG:%.png=$(BUILDDIR)/%.png.o)
DEP = $(C_SRC:%.c=$(BUILDDIR)/%.c.d) $(CPP_SRC:%.cpp=$(BUILDDIR)/%.cpp.d)
DFLAGS = $(INCLUDE) -D_7ZIP_ST -DPACKAGE_VERSION=\"1.3.3\" -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H -DENABLE_64_BIT_WORDS=0 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DVDATE=\"`date +"%y%m%d"`\"
CFLAGS = $(DFLAGS) -Wall -Wextra -Wno-strict-aliasing -Wno-stringop-overflow -Wno-stringop-truncation -Wno-format-truncation -Wno-psabi -Wno-restrict -c -O3
LFLAGS = -lc -lstdc++ -lm -lrt $(IMLIB2_LIB) -Llib/bluetooth -lbluetooth -lpthread
OUTPUT_FILTER = sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
OUTPUT_FILTER = sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
ifeq ($(PROFILING),1)
DFLAGS += -DPROFILING
endif
$(PRJ): $(OBJ)
$(BUILDDIR)/$(PRJ): $(OBJ)
$(Q)$(info $@)
$(Q)$(CC) -o $@ $+ $(LFLAGS)
$(Q)$(CC) -o $@ $+ $(LFLAGS)
$(Q)cp $@ $@.elf
$(Q)$(STRIP) $@
.PHONY: clean
clean:
$(Q)rm -f *.elf *.map *.lst *.user *~ $(PRJ)
$(Q)rm -rf obj DTAR* x64
$(Q)find . \( -name '*.o' -o -name '*.d' -o -name '*.bak' -o -name '*.rej' -o -name '*.org' \) -exec rm -f {} \;
$(Q)rm -rf bin
%.c.o: %.c
$(BUILDDIR)/%.c.o: %.c
$(Q)$(info $<)
$(Q)$(CC) $(CFLAGS) -std=gnu99 -o $@ -c $< 2>&1 | $(OUTPUT_FILTER)
%.cpp.o: %.cpp
$(BUILDDIR)/%.cpp.o: %.cpp
$(Q)$(info $<)
$(Q)$(CC) $(CFLAGS) -std=gnu++14 -Wno-class-memaccess -o $@ -c $< 2>&1 | $(OUTPUT_FILTER)
%.png.o: %.png
$(BUILDDIR)/%.png.o: %.png
$(Q)$(info $<)
$(Q)$(LD) -r -b binary -o $@ $< 2>&1 | $(OUTPUT_FILTER)
ifneq ($(MAKECMDGOALS), clean)
-include $(DEP)
endif
%.c.d: %.c
$(BUILDDIR)/%.c.d: %.c
@mkdir -p $(dir $(BUILDDIR)/$*)
$(Q)$(info $< >> $@)
$(Q)$(CC) $(DFLAGS) -MM $< -MT $@ -MT $*.c.o -MF $@ 2>&1 | $(OUTPUT_FILTER)
%.cpp.d: %.cpp
$(BUILDDIR)/%.cpp.d: %.cpp
@mkdir -p $(dir $(BUILDDIR)/$*)
$(Q)$(info $< >> $@)
$(Q)$(CC) $(DFLAGS) -MM $< -MT $@ -MT $*.cpp.o -MF $@ 2>&1 | $(OUTPUT_FILTER)
# Ensure correct time stamp
main.cpp.o: $(filter-out main.cpp.o, $(OBJ))
$(BUILDDIR)/main.cpp.o: $(filter-out $(BUILDDIR)/main.cpp.o, $(OBJ))

View File

@@ -3,6 +3,7 @@
# create simple text file named 'host' in this folder with IP address of your MiSTer.
HOST=192.168.1.75
BUILDDIR=bin
[ -f host ] && HOST=$(cat host)
# make script fail if any command failed,
@@ -22,7 +23,7 @@ open $HOST
user root 1
passive
binary
put MiSTer /media/fat/MiSTer
put $(BUILDDIR)/MiSTer /media/fat/MiSTer
EOF
plink root@$HOST -pw 1 -batch 'sync;PATH=/media/fat:$PATH;MiSTer >/dev/ttyS0 2>/dev/ttyS0 </dev/null &'