Skip to content

Commit

Permalink
Makefileに配布用ZIP作成ターゲットを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
kg68k committed Mar 17, 2022
1 parent 5053d61 commit 177e8b2
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 177e8b2

Please sign in to comment.