Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some work on i386/x86_64 architecture parameterization.
- Loading branch information
Showing
6 changed files
with
136 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
./a.out | ||
./output.s | ||
output32.s | ||
output64.s | ||
|
||
a32.out | ||
a64.out | ||
*.rkt~ | ||
|
||
################# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,43 @@ | ||
CC=gcc | ||
|
||
SCHEME=mzscheme | ||
BIN=a.out | ||
ASSEMBLY=output.s | ||
|
||
CFLAGS=-g -O3 | ||
|
||
BIN=a64.out | ||
ASSEMBLY=output64.s | ||
|
||
BIN32=a32.out | ||
ASSEMBLY32=output32.s | ||
|
||
all: $(ASSEMBLY) $(BIN) | ||
|
||
all32: $(ASSEMBLY32) $(BIN32) | ||
|
||
$(ASSEMBLY): compiler.rkt input.rkt | ||
$(SCHEME) compiler.rkt input.rkt $@ | ||
|
||
$(ASSEMBLY32): compiler.rkt input.rkt | ||
$(SCHEME) compiler.rkt input.rkt $@ x86 | ||
|
||
$(BIN32): $(ASSEMBLY32) driver.c aux.c | ||
$(CC) $(CFLAGS) -arch i386 $^ -o $(BIN32) | ||
|
||
$(BIN): $(ASSEMBLY) driver.c aux.c | ||
$(CC) -g -O3 $^ -o $(BIN) | ||
$(CC) $(CFLAGS) $^ -o $(BIN) | ||
|
||
.PHONY: clean run test | ||
.PHONY: clean run test run32 | ||
|
||
clean: | ||
rm -f $(ASSEMBLY) $(BIN) | ||
rm -f $(ASSEMBLY) $(ASSEMBLY32) $(BIN) $(BIN32) | ||
|
||
run: all | ||
lipo -info ./$(BIN) | ||
./$(BIN) | ||
|
||
run32: all32 | ||
lipo -info ./$(BIN32) | ||
./$(BIN32) | ||
|
||
test: | ||
$(SCHEME) test-cases.rkt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(= 0 1) | ||
42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters