Skip to content

Commit

Permalink
Merge pull request #18 from Sigmanificient/makefile
Browse files Browse the repository at this point in the history
create appropriate dirs on object compilation
  • Loading branch information
CobbCoding1 authored Apr 15, 2024
2 parents 40de7fd + 0c6a6cd commit 4a386fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,28 @@ TASMOBJ=$(patsubst $(SRCDIR)/tasm/%.c, $(TASMDIR)/%.o, $(TASMSRC))
TASMNAME=tasm
TASM=$(TASMDIR)/$(TASMNAME)

.PHONY: all setup clean destroy test
.PHONY: all clean destroy test

all: $(BUILDDIR)/$(OBJ) $(TIRE) $(TASM)
all: $(OBJ) $(TIRE) $(TASM)

$(BUILDDIR)/%.o: $(SRCDIR)/%.c
@ mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -c $< -o $@

$(TIRE): $(BUILDDIR)/$(TIREOBJ)
$(CC) $(CFLAGS) $(INCLUDES) $(TIREOBJ) $(OBJ) -o $(TIRE) $(LIBS)

$(BUILDDIR)/tire/%.o: $(SRCDIR)/tire/%.c
@ mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -c $< -o $@

$(TASM): $(BUILDDIR)/$(TASMOBJ)
$(CC) $(CFLAGS) $(INCLUDES) $(TASMOBJ) $(OBJ) -o $(TASM) $(LIBS)

$(BUILDDIR)/tasm/%.o: $(SRCDIR)/tasm/%.c
@ mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -c $< -o $@

setup:
mkdir -p $(BUILDDIR)
mkdir -p $(TIREDIR)
mkdir -p $(TASMDIR)

clean:
rm -rf $(TIRE)
rm -rf $(TIREOBJ)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ There is also a working assembly which contains support for all instructions in

Quick Start:
```bash
make setup
make
./tasm <assembly_file.tasm>
./tire <bytecode_file.tim>
Expand Down

0 comments on commit 4a386fb

Please sign in to comment.