Initial commit

This commit is contained in:
Peter 2023-08-24 08:50:56 +02:00
commit b63448bcb9
Signed by: pludi
GPG Key ID: FB1A00FEE77E2C36
22 changed files with 184 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
**/*.o
**/sleeptest
**/sleeptest.class

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
SUBDIRS = c cpp go java javascript perl php python rust zig
SUBCLEAN=$(addsuffix .clean,$(SUBDIRS))
.PHONY: subdirs $(SUBDIRS) clean $(SUBCLEAN)
all: subdirs
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
clean: $(SUBCLEAN)
$(SUBCLEAN): %.clean:
$(MAKE) -C $* clean

13
c/Makefile Normal file
View File

@ -0,0 +1,13 @@
CC := gcc
SRC = sleeptest.c
OUT = sleeptest
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
$(CC) -Wall -s -o $(OUT) $(SRC)
clean:
rm -f $(OUT)

5
c/sleeptest.c Normal file
View File

@ -0,0 +1,5 @@
#include <unistd.h>
void main() {
sleep(60);
}

13
cpp/Makefile Normal file
View File

@ -0,0 +1,13 @@
CPP := g++
SRC = sleeptest.cpp
OUT = sleeptest
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
$(CPP) -Wall -s -o $(OUT) $(SRC)
clean:
rm -f $(OUT)

7
cpp/sleeptest.cpp Normal file
View File

@ -0,0 +1,7 @@
#include <thread>
#include <chrono>
int main() {
std::this_thread::sleep_for(std::chrono::seconds(60));
return 0;
}

13
go/Makefile Normal file
View File

@ -0,0 +1,13 @@
GO := go
SRC = sleeptest.go
OUT = sleeptest
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
$(GO) -ldflags="-s -w" -o $(OUT) $(SRC)
clean:
rm -f $(OUT)

7
go/sleeptest.go Normal file
View File

@ -0,0 +1,7 @@
package main
import "time"
func main() {
time.Sleep(60 * time.Second)
}

13
java/Makefile Normal file
View File

@ -0,0 +1,13 @@
CC := javac
SRC = sleeptest.java
OUT = sleeptest.class
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
$(CC) -g:none $(SRC)
clean:
rm -f $(OUT)

5
java/sleeptest.java Normal file
View File

@ -0,0 +1,5 @@
public class sleeptest {
public static void main(String[] argv) throws InterruptedException {
Thread.sleep(60000);
}
}

11
javascript/Makefile Normal file
View File

@ -0,0 +1,11 @@
NODE := node
SRC = sleeptest.js
OUT = sleeptest.js
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
clean:

1
javascript/sleeptest.js Normal file
View File

@ -0,0 +1 @@
setTimeout(() => {}, 60000);

11
perl/Makefile Normal file
View File

@ -0,0 +1,11 @@
PERL := perl
SRC = sleeptest.pl
OUT = sleeptest.pl
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
clean:

1
perl/sleeptest.pl Normal file
View File

@ -0,0 +1 @@
sleep(60)

11
php/Makefile Normal file
View File

@ -0,0 +1,11 @@
PHP := php
SRC = sleeptest.php
OUT = sleeptest.php
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
clean:

3
php/sleeptest.php Normal file
View File

@ -0,0 +1,3 @@
<?php
sleep(60);

11
python/Makefile Normal file
View File

@ -0,0 +1,11 @@
PYTHON := python
SRC = sleeptest.py
OUT = sleeptest.py
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
clean:

3
python/sleeptest.py Normal file
View File

@ -0,0 +1,3 @@
import time
time.sleep(60)

13
rust/Makefile Normal file
View File

@ -0,0 +1,13 @@
RUSTC := rustc
SRC = sleeptest.rs
OUT = sleeptest
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
$(RUSTC) -C symbols -o $(OUT) $(SRC)
clean:
rm -f $(OUT)

6
rust/sleeptest.rs Normal file
View File

@ -0,0 +1,6 @@
use std::{thread, time};
pub fn main() {
let sixtysec = time::Duration::from_millis(60000);
thread::sleep(sixtysec);
}

13
zig/Makefile Normal file
View File

@ -0,0 +1,13 @@
ZIG := zig
SRC = sleeptest.zig
OUT = sleeptest
.PHONY: clean
all: $(OUT)
$(OUT): $(SRC)
$(ZIG) -Wall -s -o $(OUT) $(SRC)
clean:
rm -f $(OUT)

5
zig/sleeptest.zig Normal file
View File

@ -0,0 +1,5 @@
const time = @import("std").time;
pub fn main() void {
time.sleep(60 * time.ns_per_s);
}