-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
63 lines (42 loc) · 1.58 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
CC = gcc
CXX = g++
CFLAGS = -s -O2 -Wall
CXXFLAGS = -s -O2 -Wall
TRANSPILED = datamatrix.c datamatrix.cs datamatrix.d DataMatrixEncoder.java datamatrix.js datamatrix.py datamatrix.swift datamatrix.cl
c: dmaa.exe
echo -n 'Hello, world!' | ./dmaa.exe
cs: dmaa-cs.exe
echo -n 'Hello, world!' | ./dmaa-cs.exe
d: dmaa-d.exe
echo -n 'Hello, world!' | ./dmaa-d.exe
java: DataMatrixAsciiArtEncoder.class
echo -n 'Hello, world!' | java DataMatrixAsciiArtEncoder
py: dmaa.py datamatrix.py
echo -n 'Hello, world!' | python $<
swift: dmaa-swift
echo -n 'Hello, world!' | ./dmaa-swift
cl: dmaa-cl.exe
echo -n 'Hello, world!' | ./dmaa-cl.exe
dmaa.exe: dmaa.c datamatrix.c
$(CC) $(CFLAGS) -o $@ $^
dmaa-cs.exe: dmaa.cs datamatrix.cs
csc -nologo -o+ -out:$@ $^
dmaa-d.exe: dmaa.d datamatrix.d
dmd -of$@ -O -release $^
DataMatrixAsciiArtEncoder.class: DataMatrixAsciiArtEncoder.java DataMatrixEncoder.java
javac $^
dmaa-swift: main.swift datamatrix.swift
swiftc -o $@ $^
dmaa-cl.exe: dmaa-cl.cpp datamatrix-cl.h datamatrix.h
$(CXX) $(CXXFLAGS) -o $@ $< -lOpenCL
datamatrix-cl.h: datamatrix.cl dmaa-kernel.cl
(echo 'R"CLC(' && cat $^ && echo ')CLC"') >$@
datamatrix.h: datamatrix.c
browser: datamatrix.js
$(LOCALAPPDATA)/Programs/Opera/launcher --allow-file-access-from-files file:///$(shell cygpath -am html5datamatrix.html)
$(TRANSPILED): DataMatrixEncoder.fu
fut -o $@ $<
clean:
rm -f dmaa.exe DataMatrixAsciiArtEncoder.class DataMatrixEncoder.class dmaa-cs.exe dmaa-swift dmaa-cl.exe datamatrix-cl.h datamatrix.h $(TRANSPILED)
.PHONY: c cs d java py swift cl browser clean
.DELETE_ON_ERROR: