From 177e8b2de8d38769eaea93f6bf8b07bdf729a1b9 Mon Sep 17 00:00:00 2001 From: kg68k <78926718+kg68k@users.noreply.github.com> Date: Fri, 18 Mar 2022 01:39:48 +0900 Subject: [PATCH] =?UTF-8?q?Makefile=E3=81=AB=E9=85=8D=E5=B8=83=E7=94=A8ZIP?= =?UTF-8?q?=E4=BD=9C=E6=88=90=E3=82=BF=E3=83=BC=E3=82=B2=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Makefile | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/src/Makefile b/src/Makefile index fac4531..5840c8f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,49 +1,53 @@ # Makefile for u8tosj -AS = has +AS = has ASFLAGS = -w -LD = hlk +LD = hlk LDFLAGS = -MKDIR_P = mkdir -p +SRCS = u8tosj.s table.s +OBJS = $(SRCS:.s=.o) +U8TOSJ_R = u8tosj.r +U8TOSJ_X = u8tosj.x +DOCS = README.txt LICENSE -OBJ_DIR = o -OBJS = $(OBJ_DIR)/u8tosj.o $(OBJ_DIR)/table.o +SRC_ZIP = src.zip +U8TOSJ_ZIP = u8tosj.zip +ARCS = $(SRC_ZIP) $(U8TOSJ_ZIP) -EXES = u8tosj.r u8tosj.x +.PHONY: all clean -.PHONY: all directories clean distclean +all: $(U8TOSJ_R) -#all: directories u8tosj.r -all: directories u8tosj.x -directories: $(OBJ_DIR) +$(U8TOSJ_ZIP): $(SRC_ZIP) $(DOCS) $(U8TOSJ_R) + rm -f $@ + zip -9 $@ $^ -$(OBJ_DIR): - $(MKDIR_P) $(OBJ_DIR) +$(SRC_ZIP): Makefile $(SRCS) + rm -f $@ + zip -9 $@ $^ +LICENSE: ../LICENSE $(U8TOSJ_R) + ./$(U8TOSJ_R) < $< > $@ -u8tosj.r: $(OBJS) +README.txt: ../README.md $(U8TOSJ_R) + ./$(U8TOSJ_R) < $< > $@ + + +$(U8TOSJ_R): $(OBJS) $(LD) $(LDFLAGS) -r -o $@ $^ -u8tosj.x: $(OBJS) +$(U8TOSJ_X): $(OBJS) $(LD) $(LDFLAGS) -o $@ $^ - -$(OBJ_DIR)/%.o: %.s +%.o: %.s $(AS) $(ASFLAGS) -o $@ $^ -$(OBJ_DIR)/u8tosj.o: u8tosj.s -$(OBJ_DIR)/table.o: table.s - clean: - rm -f $(OBJS) - -distclean: - rm -f $(OBJS) $(EXES) - rm $(OBJ_DIR) + rm -f $(U8TOSJ_R) $(U8TOSJ_X) $(OBJS) $(DOCS) $(ARCS) # EOF