Skip to content

Commit

Permalink
Rename 4,5 -> 2,3
Browse files Browse the repository at this point in the history
  • Loading branch information
DQNEO committed Jul 9, 2023
1 parent a73c1c6 commit bda95b9
Show file tree
Hide file tree
Showing 30 changed files with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ goas: $(GO_SOURCES)

.PHONY: test
# Check /etc/os-release to prevent non-linux from running this
test: test1 test4 test5
test: test1 test2 test3

T1_SOURCES = $(wildcard t1/*.s)
T1_GNU_OBJS = $(T1_SOURCES:t1/%.s=out/g/1/%.o)
Expand All @@ -32,64 +32,64 @@ out/m/1/%.o: t1/%.s goas out/m/1
./goas -o $@ $<


T4_SOURCES = $(wildcard t4/*.s)
T4_GNU_OBJS = $(T4_SOURCES:t4/%.s=out/g/4/%.o)
T4_MY_OBJS = $(T4_SOURCES:t4/%.s=out/m/4/%.o)
T2_SOURCES = $(wildcard t2/*.s)
T2_GNU_OBJS = $(T2_SOURCES:t2/%.s=out/g/2/%.o)
T2_MY_OBJS = $(T2_SOURCES:t2/%.s=out/m/2/%.o)

out/g/4:
out/g/2:
mkdir -p $@

out/m/4:
out/m/2:
mkdir -p $@

# Test asm files generated by babygo's test
.PHONY: test4
test4: $(T4_GNU_OBJS) $(T4_MY_OBJS)
./tool/check-diff 4
.PHONY: test2
test2: $(T2_GNU_OBJS) $(T2_MY_OBJS)
./tool/check-diff 2
@echo ok

out/g/4/%.o: t4/%.s out/g/4 /etc/os-release
out/g/2/%.o: t2/%.s out/g/2 /etc/os-release
as -o $@ $<

out/m/4/%.o: t4/%.s goas out/m/4
out/m/2/%.o: t2/%.s goas out/m/2
./goas -o $@ $<

# Make and run babygo test
run-babygo-test: out/m/4/babygo-test out/m/4/t/text.txt
cd out/m/4 ; ./babygo-test
run-babygo-test: out/m/2/babygo-test out/m/2/t/text.txt
cd out/m/2 ; ./babygo-test

out/m/4/t/text.txt: out/m/4 t4/t/text.txt
cp -ar t4/t out/m/4/
out/m/2/t/text.txt: out/m/2 t2/t/text.txt
cp -ar t2/t out/m/2/

out/m/4/babygo-test: out/m/4/*.o
out/m/2/babygo-test: out/m/2/*.o
ld -o $@ $^

T5_SOURCES = $(wildcard t5/*.s)
T5_GNU_OBJS = $(T5_SOURCES:t5/%.s=out/g/5/%.o)
T5_MY_OBJS = $(T5_SOURCES:t5/%.s=out/m/5/%.o)
T3_SOURCES = $(wildcard t3/*.s)
T3_GNU_OBJS = $(T3_SOURCES:t3/%.s=out/g/3/%.o)
T3_MY_OBJS = $(T3_SOURCES:t3/%.s=out/m/3/%.o)

# Test asm files generated by babygo's test
test5: $(T5_GNU_OBJS) $(T5_MY_OBJS)
./tool/check-diff 5
test3: $(T3_GNU_OBJS) $(T3_MY_OBJS)
./tool/check-diff 3
@echo ok

out/m/5:
out/m/3:
mkdir -p $@

out/g/5:
out/g/3:
mkdir -p $@

out/g/5/%.o: t5/%.s out/g/5 /etc/os-release
out/g/3/%.o: t3/%.s out/g/3 /etc/os-release
as -o $@ $<

out/m/5/%.o: t5/%.s goas out/m/5
out/m/3/%.o: t3/%.s goas out/m/3
./goas -o $@ $<

# Make and run babygo 2gen
run-babygo: out/m/5/babygo
cd out/m/5 ; ./babygo version
run-babygo: out/m/3/babygo
cd out/m/3 ; ./babygo version

out/m/5/babygo: out/m/5/*.o
out/m/3/babygo: out/m/3/*.o
ld -o $@ $^

clean:
Expand Down
Binary file added out/m/2/babygo-test
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit bda95b9

Please sign in to comment.