From 084352898add00b9bd7cddaaa8d1bf80f359cedc Mon Sep 17 00:00:00 2001 From: Doohyeon Won Date: Fri, 12 Jun 2026 23:36:43 +0900 Subject: [PATCH 1/5] fix: rewrite btn makefile --- btn/c/Makefile | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/btn/c/Makefile b/btn/c/Makefile index 53dd418..36d2d13 100644 --- a/btn/c/Makefile +++ b/btn/c/Makefile @@ -1,15 +1,41 @@ -CC = gcc -CCFLAGS = -O -Wall -W -pedantic +## Variables ## +TARGET := btn -TARGET = btn +CC := gcc +CFLAGS := -O -Wall -W -pedantic +CFLAGS += -g +CFLAGS += -MMD -MP +CPPFLAGS = \ + -I $(DIR_LIB) \ + -DPROGNAME='"$(TARGET)"' -SOURCES = $(wildcard ./*.c) -OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) +SOURCES = $(wildcard *.c) +LIB_SRCS = $(wildcard $(DIR_LIB)/*.c) +OBJECTS = $(SOURCES:.c=.o) +LIB_OBJS = $(notdir $(LIB_SRCS:.c=.o)) +DIR_LIB := ../../lib + +## Targets ## +.PHONY: all clean + +## Default Goal ## all: $(TARGET) -$(TARGET): $(OBJECTS) - $(CC) $(CCFLAGS) -o $@ $^ +## Build ## +$(TARGET): $(OBJECTS) $(LIB_OBJS) + $(CC) $^ $(CFLAGS) -o $@ + +$(OBJECTS): %.o: %.c + $(CC) $< $(CPPFLAGS) $(CFLAGS) -c -o $@ + +$(LIB_OBJS): %.o: $(DIR_LIB)/%.c + $(CC) $< $(CPPFLAGS) $(CFLAGS) -c -o $@ + +## Dependency ## +-include $(OBJECTS:.o=.d) +-include $(LIB_OBJS:.o=.d) -%.o: %.c - $(CC) $(CCFLAGS) -c -o $@ $< +## Tasks ## +clean: + rm -f $(TARGET) *.o *.d From ff7fa80e65af3181a5e41aab786cb596ca82ff29 Mon Sep 17 00:00:00 2001 From: Doohyeon Won Date: Fri, 12 Jun 2026 23:43:41 +0900 Subject: [PATCH 2/5] fix: rewrite hd makefile --- hd/c/Makefile | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/hd/c/Makefile b/hd/c/Makefile index 8dedf72..6605b13 100644 --- a/hd/c/Makefile +++ b/hd/c/Makefile @@ -1,15 +1,41 @@ -CC = gcc -CCFLAGS = -O -Wall -W -pedantic +## Variables ## +TARGET := hd -TARGET = hd +CC := gcc +CFLAGS := -O -Wall -W -pedantic +CFLAGS += -g +CFLAGS += -MMD -MP +CPPFLAGS = \ + -I $(DIR_LIB) \ + -DPROGNAME='"$(TARGET)"' -SOURCES = $(wildcard ./*.c) -OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) +SOURCES = $(wildcard *.c) +LIB_SRCS = $(wildcard $(DIR_LIB)/*.c) +OBJECTS = $(SOURCES:.c=.o) +LIB_OBJS = $(notdir $(LIB_SRCS:.c=.o)) +DIR_LIB := ../../lib + +## Targets ## +.PHONY: all clean + +## Default Goal ## all: $(TARGET) -$(TARGET): $(OBJECTS) - $(CC) $(CCFLAGS) -o $@ $^ +## Build ## +$(TARGET): $(OBJECTS) $(LIB_OBJS) + $(CC) $^ $(CFLAGS) -o $@ + +$(OBJECTS): %.o: %.c + $(CC) $< $(CPPFLAGS) $(CFLAGS) -c -o $@ + +$(LIB_OBJS): %.o: $(DIR_LIB)/%.c + $(CC) $< $(CPPFLAGS) $(CFLAGS) -c -o $@ + +## Dependency ## +-include $(OBJECTS:.o=.d) +-include $(LIB_OBJS:.o=.d) -%.o: %.c - $(CC) $(CCFLAGS) -c -o $@ $< +## Tasks ## +clean: + rm -f $(TARGET) *.o *.d From d1c9a6d1f3c4fe064b2e8a68108e01bea0c7da20 Mon Sep 17 00:00:00 2001 From: Doohyeon Won Date: Fri, 12 Jun 2026 23:44:47 +0900 Subject: [PATCH 3/5] fix: rewrite nsy makefile --- nsy/c/Makefile | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/nsy/c/Makefile b/nsy/c/Makefile index 9deb712..52bf45b 100644 --- a/nsy/c/Makefile +++ b/nsy/c/Makefile @@ -1,15 +1,41 @@ -CC = gcc -CCFLAGS = -O -Wall -W -pedantic +## Variables ## +TARGET := nsy -TARGET = nsy +CC := gcc +CFLAGS := -O -Wall -W -pedantic +CFLAGS += -g +CFLAGS += -MMD -MP +CPPFLAGS = \ + -I $(DIR_LIB) \ + -DPROGNAME='"$(TARGET)"' -SOURCES = $(wildcard ./*.c) -OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) +SOURCES = $(wildcard *.c) +LIB_SRCS = $(wildcard $(DIR_LIB)/*.c) +OBJECTS = $(SOURCES:.c=.o) +LIB_OBJS = $(notdir $(LIB_SRCS:.c=.o)) +DIR_LIB := ../../lib + +## Targets ## +.PHONY: all clean + +## Default Goal ## all: $(TARGET) -$(TARGET): $(OBJECTS) - $(CC) $(CCFLAGS) -o $@ $^ +## Build ## +$(TARGET): $(OBJECTS) $(LIB_OBJS) + $(CC) $^ $(CFLAGS) -o $@ + +$(OBJECTS): %.o: %.c + $(CC) $< $(CPPFLAGS) $(CFLAGS) -c -o $@ + +$(LIB_OBJS): %.o: $(DIR_LIB)/%.c + $(CC) $< $(CPPFLAGS) $(CFLAGS) -c -o $@ + +## Dependency ## +-include $(OBJECTS:.o=.d) +-include $(LIB_OBJS:.o=.d) -%.o: %.c - $(CC) $(CCFLAGS) -c -o $@ $< +## Tasks ## +clean: + rm -f $(TARGET) *.o *.d From 6a0cce478f23f3b3130be360b396f38c297322a8 Mon Sep 17 00:00:00 2001 From: Doohyeon Won Date: Fri, 12 Jun 2026 23:45:17 +0900 Subject: [PATCH 4/5] fix: rewrite nsy2 makefile --- nsy2/c/Makefile | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/nsy2/c/Makefile b/nsy2/c/Makefile index acf9434..9c6b5f8 100644 --- a/nsy2/c/Makefile +++ b/nsy2/c/Makefile @@ -1,15 +1,41 @@ -CC = gcc -CCFLAGS = -O -Wall -W -pedantic +## Variables ## +TARGET := nsy2 -TARGET = nsy2 +CC := gcc +CFLAGS := -O -Wall -W -pedantic +CFLAGS += -g +CFLAGS += -MMD -MP +CPPFLAGS = \ + -I $(DIR_LIB) \ + -DPROGNAME='"$(TARGET)"' -SOURCES = $(wildcard ./*.c) -OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) +SOURCES = $(wildcard *.c) +LIB_SRCS = $(wildcard $(DIR_LIB)/*.c) +OBJECTS = $(SOURCES:.c=.o) +LIB_OBJS = $(notdir $(LIB_SRCS:.c=.o)) +DIR_LIB := ../../lib + +## Targets ## +.PHONY: all clean + +## Default Goal ## all: $(TARGET) -$(TARGET): $(OBJECTS) - $(CC) $(CCFLAGS) -o $@ $^ +## Build ## +$(TARGET): $(OBJECTS) $(LIB_OBJS) + $(CC) $^ $(CFLAGS) -o $@ + +$(OBJECTS): %.o: %.c + $(CC) $< $(CPPFLAGS) $(CFLAGS) -c -o $@ + +$(LIB_OBJS): %.o: $(DIR_LIB)/%.c + $(CC) $< $(CPPFLAGS) $(CFLAGS) -c -o $@ + +## Dependency ## +-include $(OBJECTS:.o=.d) +-include $(LIB_OBJS:.o=.d) -%.o: %.c - $(CC) $(CCFLAGS) -c -o $@ $< +## Tasks ## +clean: + rm -f $(TARGET) *.o *.d From e6a742fa28c452c3752c96ed88aa0c6d64d7e7f7 Mon Sep 17 00:00:00 2001 From: Doohyeon Won Date: Sat, 13 Jun 2026 00:05:51 +0900 Subject: [PATCH 5/5] fix: organize gitignores --- btn/c/.gitignore | 6 ++++-- hd/c/.gitignore | 7 +++++-- hhss/c/.gitignore | 1 + nsy/c/.gitignore | 6 ++++-- nsy2/c/.gitignore | 5 ++++- test/.gitignore | 3 ++- yandere/c/.gitignore | 1 + 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/btn/c/.gitignore b/btn/c/.gitignore index 86c5f69..f802e99 100644 --- a/btn/c/.gitignore +++ b/btn/c/.gitignore @@ -1,5 +1,7 @@ btn btn.exe -btn.o -.dat \ No newline at end of file +*.o +*.d + +.dat diff --git a/hd/c/.gitignore b/hd/c/.gitignore index 82026ae..1310530 100644 --- a/hd/c/.gitignore +++ b/hd/c/.gitignore @@ -1,4 +1,7 @@ -tmp hd hd.exe -hd.o \ No newline at end of file + +*.o +*.d + +tmp diff --git a/hhss/c/.gitignore b/hhss/c/.gitignore index 6dfabfe..2c7bfbe 100644 --- a/hhss/c/.gitignore +++ b/hhss/c/.gitignore @@ -1,4 +1,5 @@ hhss hhss.exe + *.o *.d diff --git a/nsy/c/.gitignore b/nsy/c/.gitignore index 2103688..45879fb 100644 --- a/nsy/c/.gitignore +++ b/nsy/c/.gitignore @@ -1,5 +1,7 @@ nsy nsy.exe -nsy.o -.dat \ No newline at end of file +*.o +*.d + +.dat diff --git a/nsy2/c/.gitignore b/nsy2/c/.gitignore index 4e44f2f..935da00 100644 --- a/nsy2/c/.gitignore +++ b/nsy2/c/.gitignore @@ -1,2 +1,5 @@ nsy2 -nsy2.o \ No newline at end of file +nsy2.exe + +*.o +*.d diff --git a/test/.gitignore b/test/.gitignore index 5c369ed..6a0b763 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1,3 +1,4 @@ test test_maker -test_maker.o + +*.o diff --git a/yandere/c/.gitignore b/yandere/c/.gitignore index 1f6c70d..4ae7d1e 100644 --- a/yandere/c/.gitignore +++ b/yandere/c/.gitignore @@ -1,4 +1,5 @@ yandere yandere.exe + *.o *.d