Skip to content

Commit 0ab9cc9

Browse files
committed
first build-test
1 parent 3e1ffbb commit 0ab9cc9

File tree

8 files changed

+94
-23
lines changed

8 files changed

+94
-23
lines changed

.github/workflows/ci.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: D build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
runs-on: [ubuntu-latest]
11+
runs-on: ${{ matrix.runs-on }}
12+
container:
13+
image: kassany/ldc-mos
14+
defaults:
15+
run:
16+
shell: bash
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
fetch-depth: 0
22+
23+
- name: Build
24+
run: bash build.sh

.gitignore

+10-23
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
# Compiled Object files
2-
*.o
3-
*.obj
4-
5-
# Compiled Dynamic libraries
6-
*.so
7-
*.dylib
8-
*.dll
9-
10-
# Compiled Static libraries
11-
*.a
12-
*.lib
1+
build/
2+
zig-*/
3+
apple-*/
134

14-
# Executables
15-
*.exe
16-
17-
# DUB
18-
.dub
19-
docs.json
20-
__dummy.html
21-
docs/
22-
23-
# Code coverage
24-
*.lst
5+
*.obj*
6+
*.o
7+
*.nes*
8+
*.mlb
9+
*.elf
10+
*.sys*
11+
*.prg*

build.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
ROOTPATH=$(pwd)
4+
5+
# C64 examples
6+
cd c64/hello
7+
bash build.sh
8+
ls -lh
9+
cd $ROOTPATH
10+
# cd c64/fibonacci
11+
# bash build.sh
12+
# ls -lh
13+
# cd $ROOTPATH

c64/fibonacci/build.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
ldmd2 -i \
4+
-betterC \
5+
-I ../../modules/common \
6+
hello.d \
7+
-mtriple=mos-unknown-unknown \
8+
--release \
9+
-O \
10+
-of=fib.prg \
11+
-gcc=mos-c64-clang \
12+
-linker=lld
13+
14+
rm *.o*

c64/hello/build.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
ldmd2 -i \
4+
-betterC \
5+
-I$PWD/../../modules \
6+
src/hello.d \
7+
-mtriple=mos-unknown-unknown \
8+
--release \
9+
-O \
10+
-of=hello.prg \
11+
-gcc=mos-c64-clang \
12+
-linker=lld
13+
14+
rm *.o*

c64/hello/src/hello.d

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import common: printf;
2+
3+
extern(C)
4+
void main() {
5+
printf("Hello World in D!\n");
6+
}

modules/common.d

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module common;
2+
public import include;

modules/include.c

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include </opt/llvm-mos-sdk/mos-platform/common/include/stdio.h>
2+
#include </opt/llvm-mos-sdk/mos-platform/common/include/stdlib.h>
3+
#include </opt/llvm-mos-sdk/mos-platform/common/include/string.h>
4+
#include </opt/llvm-mos-sdk/mos-platform/common/include/6502.h>
5+
#include </opt/llvm-mos-sdk/mos-platform/common/include/math.h>
6+
#include </opt/llvm-mos-sdk/mos-platform/common/include/wchar.h>
7+
// #include </opt/llvm-mos-sdk/mos-platform/common/include/soa.h> // ERROR
8+
#include </opt/llvm-mos-sdk/mos-platform/common/include/signal.h>
9+
#include </opt/llvm-mos-sdk/mos-platform/common/include/peekpoke.h>
10+
#include </opt/llvm-mos-sdk/mos-platform/common/include/time.h>
11+
#include </opt/llvm-mos-sdk/mos-platform/common/include/alloca.h>

0 commit comments

Comments
 (0)