compiler

Unnamed Compiled Systems Language Project
git clone http://frotz.net/git/compiler.git
Log | Files | Refs

commit 0acd25e23eb849d8570612c2eb44d864e6ad04eb
parent 5833bfe8d8eff3d9a08f440f5b3905c78587f613
Author: Brian Swetland <swetland@frotz.net>
Date:   Mon,  2 Mar 2020 11:39:20 -0800

makefile and fixes

Diffstat:
AMakefile | 20++++++++++++++++++++
Msrc/r5dis.c | 3++-
2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,20 @@ + +all: bin/tlc bin/fs bin/r5dis + +clean: + rm -rf bin out + +CFLAGS := -Wall -O2 -g +CC := gcc + +bin/tlc: src/tlc.c + @mkdir -p bin + $(CC) -o $@ $(CFLAGS) src/tlc.c + +bin/fs: src/fs.c src/fs.h + @mkdir -p bin + $(CC) -o $@ $(CFLAGS) src/fs.c + +bin/r5dis: src/r5dis.c + @mkdir -p bin + $(CC) -o $@ $(CFLAGS) src/r5dis.c diff --git a/src/r5dis.c b/src/r5dis.c @@ -6,6 +6,7 @@ #include <stdint.h> #include <unistd.h> #include <fcntl.h> +#include <string.h> static const char* opname[16] = { "MOV", "LSL", "ASR", "ROR", "AND", "ANN", "IOR", "XOR", @@ -187,7 +188,7 @@ int main(int argc, char** argv) { uint32_t count; count = strlen(argv[1]); - if ((count > 5) && (!strcmp(argv + count - 4, ".rsc"))) { + if ((count > 5) && (!strcmp(argv[1] + count - 4, ".rsc"))) { count = dishdr(fd); } else { count = 0xffffffff;