set base for dev env makefile readme gitignore and a basic main.c

This commit is contained in:
smayzy 2025-12-06 20:06:26 +01:00
parent 0cbf4f7de6
commit 2242392d54
6 changed files with 76 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
cocomobile-tui

15
Makefile Normal file
View File

@ -0,0 +1,15 @@
CC := gcc
CFLAGS := -Wall -Wextra -O2
LDFLAGS := -lncurses
SRC := src/main.c
TARGET := cocomobile-tui
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(SRC)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
rm -f $(TARGET)

View File

@ -1,2 +1,4 @@
# cocomobile-tui
# Dependencies
- ncurses (libncursesw.so.6)

27
flake.lock generated Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1764950072,
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f61125a668a320878494449750330ca58b78c557",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

19
flake.nix Normal file
View File

@ -0,0 +1,19 @@
{
description = "cocomobile dev env";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs;[
gcc
gdb
ncurses
];
};
};
}

12
src/main.c Normal file
View File

@ -0,0 +1,12 @@
#include <ncurses.h>
int main()
{
initscr();
printw("Hello World !!!");
refresh();
getch();
endwin();
return 0;
}