-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build lots more stuff, including libcuss programs. Fix some commit bugs.
- Loading branch information
1 parent
149b6a7
commit 3adec94
Showing
6 changed files
with
117 additions
and
15 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,3 +1,5 @@ | ||
.obj | ||
.vscode | ||
__pycache__ | ||
.*\.orig | ||
|
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
ifeq ($(findstring 4.,$(MAKE_VERSION)),) | ||
$(error You need GNU Make 4.x for this (if you're on OSX, use gmake).) | ||
endif | ||
|
||
OBJ ?= .obj | ||
PYTHON ?= python3 | ||
CC ?= gcc | ||
CXX ?= g++ | ||
AR ?= ar | ||
CFLAGS ?= -g -Og | ||
LDFLAGS ?= -g | ||
PKG_CONFIG ?= pkg-config | ||
ECHO ?= echo | ||
TARGETS ?= +all | ||
|
||
ifdef VERBOSE | ||
hide = | ||
else | ||
ifdef V | ||
hide = | ||
else | ||
hide = @ | ||
endif | ||
endif | ||
|
||
ifeq ($(OS), Windows_NT) | ||
EXT ?= .exe | ||
endif | ||
EXT ?= | ||
|
||
include $(OBJ)/build.mk | ||
|
||
MAKEFLAGS += -r | ||
.DELETE_ON_ERROR: | ||
|
||
.PHONY: update-ab | ||
update-ab: | ||
@echo "Press RETURN to update ab from the repository, or CTRL+C to cancel." \ | ||
&& read a \ | ||
&& (curl -L https://github.com/davidgiven/ab/releases/download/dev/distribution.tar.xz | tar xvJf -) \ | ||
&& echo "Done." | ||
|
||
.PHONY: clean | ||
clean:: | ||
@echo CLEAN | ||
$(hide) rm -rf $(OBJ) | ||
|
||
export PYTHONHASHSEED = 1 | ||
build-files = $(shell find . -name 'build.py') $(wildcard build/*.py) $(wildcard config.py) | ||
$(OBJ)/build.mk: Makefile $(build-files) | ||
@echo "AB" | ||
@mkdir -p $(OBJ) | ||
$(hide) $(PYTHON) -X pycache_prefix=$(OBJ) build/ab.py -o $@ build.py \ | ||
|| rm -f $@ |
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,13 +1,27 @@ | ||
from build.c import cprogram | ||
from build.ab import emit | ||
from build.c import cprogram, clibrary | ||
|
||
emit( | ||
""" | ||
ACKCC ?= ack | ||
ACKAAL ?= aal | ||
""" | ||
) | ||
|
||
|
||
class AckToolchain: | ||
label = "ACK" | ||
cfile = ["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"] | ||
cxxfile = ["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"] | ||
clibrary = ["$(AR) cqs {outs[0]} {ins}"] | ||
cxxlibrary = ["$(AR) cqs {outs[0]} {ins}"] | ||
cprogram = ["$(CC) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"] | ||
cxxprogram = ["$(CXX) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"] | ||
cfile = ["$(ACKCC) -mcpm -c -o {outs[0]} {ins[0]} $(ACKCFLAGS) {cflags}"] | ||
cxxfile = (["false"],) | ||
clibrary = ["$(ACKAAL) cq {outs[0]} {ins}"] | ||
cxxlibrary = (["false"],) | ||
cprogram = ["$(ACKCC) -mcpm -.c -o {outs[0]} {ins} {ldflags} $(ACKLDFLAGS)"] | ||
cxxprogram = (["false"],) | ||
|
||
|
||
def acklibrary(**kwargs): | ||
return clibrary(**kwargs, toolchain=AckToolchain) | ||
|
||
|
||
def ackprogram(**kwargs): | ||
return cprogram(**kwargs, toolchain=AckToolchain) |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from build.ack import acklibrary, ackprogram | ||
from glob import glob | ||
|
||
libcuss_terminals = [ | ||
"KAYPROII", | ||
"NC200", | ||
"BROTHEROP2", | ||
"BROTHER_WP1", | ||
"BROTHER_WP2450DS", | ||
"BROTHER_POWERNOTE", | ||
"SPECTRUM_PLUS_THREE", | ||
"SPECTRUM_NEXT", | ||
] | ||
|
||
for terminal in libcuss_terminals: | ||
acklibrary( | ||
name="libcuss_" + terminal, | ||
cflags=["-DLIBCUSS_" + terminal], | ||
srcs=glob("cpmtools/libcuss/*.c"), | ||
hdrs={"libcuss.h": "./libcuss.h"}, | ||
) | ||
|
||
|
||
def libcuss_ackprogram(name, deps=[], cflags=[], **kwargs): | ||
for terminal in libcuss_terminals: | ||
ackprogram( | ||
name=name + "_" + terminal, | ||
deps=deps + ["cpmtools/libcuss+libcuss_" + terminal], | ||
cflags=["-DLIBCUSS_"+terminal] + cflags, | ||
**kwargs | ||
) |
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