From 2242392d54f9900498c966f1dea35d1854ff199a Mon Sep 17 00:00:00 2001 From: smayzy Date: Sat, 6 Dec 2025 20:06:26 +0100 Subject: [PATCH] set base for dev env makefile readme gitignore and a basic main.c --- .gitignore | 1 + Makefile | 15 +++++++++++++++ README.md | 2 ++ flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 19 +++++++++++++++++++ src/main.c | 12 ++++++++++++ 6 files changed, 76 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 src/main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d5defa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +cocomobile-tui diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..20cc40a --- /dev/null +++ b/Makefile @@ -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) diff --git a/README.md b/README.md index 4e6d246..ae1a657 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # cocomobile-tui +# Dependencies +- ncurses (libncursesw.so.6) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..65e4798 --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3255b9a --- /dev/null +++ b/flake.nix @@ -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 + ]; + }; + }; +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..6d158fe --- /dev/null +++ b/src/main.c @@ -0,0 +1,12 @@ +#include + +int main() +{ + initscr(); + printw("Hello World !!!"); + refresh(); + getch(); + endwin(); + + return 0; +}