fix makefile for hw3 and add hw3/*.dat and main.c

This commit is contained in:
2025-10-13 03:18:15 +09:00
parent 5fb912b414
commit cdcf1a079b
5 changed files with 89 additions and 3 deletions

View File

@@ -18,8 +18,8 @@ else
LIB_SRCS := $(LIB_DIR)/recipes/machar.c
else ifeq ($(strip $(hw)),2)
LIB_SRCS := $(LIB_DIR)/other/nrutil.c $(LIB_DIR)/recipes/rtflsp.c $(LIB_DIR)/recipes/rtbis.c $(LIB_DIR)/recipes/rtsec.c $(LIB_DIR)/recipes/rtnewt.c $(LIB_DIR)/recipes/rtsafe.c $(LIB_DIR)/recipes/zbrak.c $(LIB_DIR)/recipes/bessj0.c $(LIB_DIR)/recipes/bessj1.c
else
LIB_SRCS := ""
else ifeq ($(strip $(hw)),3)
LIB_SRCS := $(LIB_DIR)/other/nrutil.c $(LIB_DIR)/recipes/gaussj.c $(LIB_DIR)/recipes/ludcmp.c $(LIB_DIR)/recipes/svdcmp.c $(LIB_DIR)/recipes/mprove.c $(LIB_DIR)/recipes/lubksb.c $(LIB_DIR)/recipes/pythag.c
endif
LIB_OBJS := $(patsubst %.c,$(BUILD_DIR)/lib/%.o,$(notdir $(LIB_SRCS)))
@@ -65,7 +65,10 @@ $(OBJS): %.o:
run: clean build
@echo "실행 시작"
@echo "============"
@$(TARGET_EXEC)
@if ls $(SRC_DIR)/*.dat >/dev/null 2>&1; then \
cp -f $(SRC_DIR)/*.dat build/; \
fi
@cd build && ./$(TARGET_NAME).out
dist: clean
mkdir -p out