Created
November 22, 2015 14:22
-
-
Save takeutch-kemeco/edbe1b1224242514a3bd to your computer and use it in GitHub Desktop.
osecpu132d/vm/linux/
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
CC = gcc | |
RM = rm | |
DEFS = | |
CFLAGS = -Os -Wl,-s | |
LIBS = | |
TOL_PROG = osectols | |
TOL_DIR = tol | |
TOL_SRCS = $(TOL_DIR)/osectols.c | |
TOL_OBJS = $(TOL_SRCS:.c=.o) | |
TOL_CFLAGS = $(CFLAGS) -I./tol | |
TOL_LIBS = $(LIBS) | |
TOL_DEFS = $(DEFS) | |
VM_PROG = osecpu | |
VM_DIR = vm | |
VM_SRCS = $(VM_DIR)/osecpu-vm.c $(VM_DIR)/osecpu-vm.h \ | |
$(VM_DIR)/other.c \ | |
$(VM_DIR)/integer.c \ | |
$(VM_DIR)/pointer.c \ | |
$(VM_DIR)/float.c \ | |
$(VM_DIR)/extend.c \ | |
$(VM_DIR)/api.c \ | |
$(VM_DIR)/driver.c \ | |
$(VM_DIR)/decode.c \ | |
$(VM_DIR)/tek.c \ | |
$(VM_DIR)/debug.c | |
VM_OBJS = $(VM_SRCS:.c=.o) | |
VM_CFLAGS = $(CFLAGS) -I./vm `pkg-config blike --cflags` | |
VM_LIBS = $(LIBS) `pkg-config blike --libs` | |
VM_DEFS = $(DEFS) -D__linux__ | |
ASKA = ./$(TOL_PROG) tool:aska | |
LBSTK = ./$(TOL_PROG) tool:lbstk | |
DB2BIN = ./$(TOL_PROG) tool:db2bin | |
APPACK = ./$(TOL_PROG) tool:appack | |
all: | |
%.ose: %.4cas $(TOL_PROG) $(VM_PROG) | |
$(APPACK) in:$< out:$@ | |
%.4cas: %.3cas $(TOL_PROG) $(VM_PROG) | |
$(DB2BIN) in:$< out:$@ | |
%.3cas: %.2cas $(TOL_PROG) | |
$(LBSTK) in:$< out:$@ lst:%.3lbl | |
%.2cas: %.1oas | |
$(CC) -E -P -o $@ -x c $< | |
%.1oas: %.0ask $(TOL_PROG) | |
$(ASKA) in:$< out:$@ | |
%.0ask: %.ask | |
$(CC) -E -o $@ -x c $< | |
$(TOL_PROG): $(TOL_OBJS) | |
$(CC) $(TOL_DEFS) $(TOL_CFLAGS) $(TOL_LIBS) -o $@ $(TOL_OBJS) | |
$(VM_PROG): $(VM_OBJS) | |
$(CC) $(VM_DEFS) $(VM_CFLAGS) $(VM_LIBS) -o $@ $(VM_OBJS) | |
.c.o: | |
$(CC) $(DEFS) -c -o $@ $< | |
clean-ose-vm: | |
$(RM) -f $(VM_PROG) | |
$(RM) -f $(VM_DIR)/*.o | |
clean-ose-tol: | |
$(RM) -f $(TOL_PROG) | |
$(RM) -f tol/*.o | |
clean: clean-ose-vm \ | |
clean-ose-tol | |
install: | |
uninstall: | |
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
linuxでの遊び方: | |
書いた人:kemeppoさん 2015/11/22ごろ | |
0. ビルドの準備の準備 (c_blike_01f のインストール) | |
まず c_blike_01f をインストールしときます。 | |
git clone https://github.com/takeutch-kemeco/blike.git | |
cd blike | |
./autogen.sh | |
./configure --prefix=/usr | |
make | |
sudo make install | |
備考: | |
たぶん Ubuntu なら gtk+3, autoconf, automake, libtool, pkg-config あと xkbcommon も必要かもしれません。 | |
Ubuntu 系なら全部 apt-get で入るよ。 | |
備考: | |
c_blike_01f をアンインストールしたい場合は sudo make uninstall です。 | |
1. ビルドの準備(osecpu, osectols のビルド) | |
osecpuパッケージの先頭ディレクトリー内で | |
ln -sf ./vm/linux/Makefile | |
ってしときます。 | |
これで、ここに Makefile ができて、 | |
make ○○.ose | |
とすることで ○○.ask をコンパイルできるようになります。 | |
2. ためしにサンプルをビルドしてみよう | |
osecpuパッケージの先頭ディレクトリー内で | |
make ask0107.ose | |
これでソースコード ask0107.ask を、実行バイナリー ask0107.ose へコンパイルできます。 | |
(make ○○.ask じゃなくて、 make ○○.ose と書くようになってるので注意) | |
これを | |
./osecpu ask0107.ose | |
とすると、ゲームらしきものが動きます。 | |
3. 自分でソースコード ○○.ask を書いて動かしてみよう。 | |
がんばってください。(投げっぱなし) | |
で、がんばったソースコード ○○.ask を | |
make ○○.ose | |
./osecpu ○○.ose | |
とすることで動かせます。 | |
作ったアプリとソースコードは http://osecpu.osask.jp/wiki/ で自慢すると良いと思います。 | |
以上です。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment