aboutsummaryrefslogtreecommitdiff
path: root/tools/hex2bin-2.0/Makefile
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-11-05 11:22:55 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-11-05 11:31:28 +0000
commit2fbdf974338bde8576efdae40a819a76b2391033 (patch)
tree64d41a37470143f142344f9a439d96de3e7918c2 /tools/hex2bin-2.0/Makefile
downloadkitsunes-curse-2fbdf974338bde8576efdae40a819a76b2391033.tar.gz
kitsunes-curse-2fbdf974338bde8576efdae40a819a76b2391033.zip
Initial import of the open source release
Diffstat (limited to 'tools/hex2bin-2.0/Makefile')
-rwxr-xr-xtools/hex2bin-2.0/Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/tools/hex2bin-2.0/Makefile b/tools/hex2bin-2.0/Makefile
new file mode 100755
index 0000000..bc5e71a
--- /dev/null
+++ b/tools/hex2bin-2.0/Makefile
@@ -0,0 +1,42 @@
+# Makefile hex2bin/mot2bin
+SRCDIR = src
+BINDIR = bin
+OBJDIR = obj
+TGTDIR = $(BINDIR)
+B_SRCFILES= $(foreach F, hex2bin.c common.c libcrc.c binary.c, $(SRCDIR)/$(F))
+B_OBJFILES= $(foreach F, hex2bin.o common.o libcrc.o binary.o, $(OBJDIR)/$(F))
+M_SRCFILES= $(foreach F, mot2bin.c common.c libcrc.c binary.c, $(SRCDIR)/$(F))
+M_OBJFILES= $(foreach F, mot2bin.o common.o libcrc.o binary.o, $(OBJDIR)/$(F))
+
+# For generating documentation (hex2bin.1, select the second line)
+# -- You will require pod2man installed for this to work
+TGT_FILES = $(foreach F, hex2bin mot2bin, $(TGTDIR)/$(F))
+#TGT_FILES = $(foreach F, hex2bin mot2bin hex2bin.1, $(TGTDIR)/$(F))
+
+CPFLAGS = -std=gnu99 -O3 -fsigned-char -Wall -pedantic -fcommon
+# Compile
+all: objectdir $(TGT_FILES)
+
+$(OBJDIR)/%.o: $(SRCDIR)/%.c
+ gcc -c $(CPFLAGS) $< -o $@
+
+objectdir:
+ @echo "Creating directory $(OBJDIR)..."
+ mkdir -p $(OBJDIR)
+
+$(TGTDIR)/hex2bin.1: $(SRCDIR)/hex2bin.pod
+ pod2man $(SRCDIR)/hex2bin.pod > $(TGTDIR)/hex2bin.1
+
+$(TGTDIR)/hex2bin: $(B_OBJFILES)
+ gcc $(CPFLAGS) -o $(TGTDIR)/hex2bin $(B_OBJFILES)
+
+$(TGTDIR)/mot2bin: $(M_OBJFILES)
+ gcc $(CPFLAGS) -o $(TGTDIR)/mot2bin $(M_OBJFILES)
+
+clean:
+ @echo "Removing objects directory $(OBJDIR)/ ..."
+ @rm -rf $(OBJDIR)
+
+cleanall: clean
+ @echo "Removing binary files in $(BINDIR)/ ..."
+ @rm -f $(BINDIR)/*