feat(assign1): add basic "Hello World" program
This commit is contained in:
parent
95cd73423a
commit
0122c877ac
4 changed files with 33 additions and 2 deletions
8
assign1/c-programs/hello.c
Normal file
8
assign1/c-programs/hello.c
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("Welcome to OwlTech Industries!\n");
|
||||
printf("Systems Programming Division\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
12
assign1/default.nix
Normal file
12
assign1/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
assign1-hello = { stdenv }:
|
||||
stdenv.mkDerivation {
|
||||
name = "hello";
|
||||
src = ./.;
|
||||
buildPhase = "gcc c-programs/hello.c -o hello";
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
install hello $out/bin/hello
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue