commit f183ed21470945b2b62128376cd6252dcf8c37ea Author: Randy Jordan Date: Sun Feb 8 12:14:24 2026 -0600 Initial commit diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8aa2645 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [year] [fullname] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d05218b --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +# Compiler settings +CC=gcc +CFLAGS=-std=c11 -Wall -Wextra -O2 -Iinclude +SHELL=/bin/sh + +# Directories +SRCDIR=src +INCDIR=include +OBJDIR=build +DISTDIR=dist +TESTDIR=tests + +# Platform-specific sources +ifeq ($(OS),Windows_NT) + PLATFORM_SRC=$(SRCDIR)/win32_platform.c + OBJEXT=obj + LIBEXT=dll + RM=del /Q + MKDIR=if not exist "$(1)" mkdir "$(1)" +else + PLATFORM_SRC=$(SRCDIR)/linux_platform.c + OBJEXT=o + LIBEXT=so + RM=rm -f + MKDIR=mkdir -p $(1) +endif + +# Sources and objects +SRC=$(PLATFORM_SRC) $(TESTDIR)/main.c +OBJ=$(patsubst %.c,$(OBJDIR)/%.$(OBJEXT),$(SRC)) + +# Targets +.PHONY: all clean run + +all: $(DISTDIR)/app + +# Build main executable +$(DISTDIR)/app: $(OBJ) + @$(call MKDIR,$(DISTDIR)) + $(CC) $(CFLAGS) $(OBJ) -o $@ + +# Compile object files +$(OBJDIR)/%.$(OBJEXT): %.c + @$(call MKDIR,$(dir $@)) + $(CC) $(CFLAGS) -c $< -o $@ + +# Run the app +run: $(DISTDIR)/app + $(DISTDIR)/app + +# Clean +clean: + -$(RM) $(OBJ) + -$(RM) $(DISTDIR)/* + @echo "Cleaned build and dist directories" + diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9f3382 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# EG + +## Description +This repository contains eg or "for example" files. That includes this README and LICENSE. +`~/eg`is a $HOME directory for me and is marked as an XDG template folder. +This allows you to easily create files from "templates" on a desktop. +It also serves as a filepath `~/eg` for scripts and automation. + +## Table of Contents + +- [Description](#description) +- [Features](#features) +- [Usage](#usage) +- [Credits / Resources](#credits--resources) +- [License](#license) + +## Features ++ Easy to copy. ++ Defaults to revert to. ++ Templates for easy productivity. + + +## Usage +Just copy and paste into your projects.
+/dev - Files used in development.
+/dot - Files used in configuration.
+ +## Credits / Resources +[Tom Preston-Werner README Driven Development](https://tom.preston-werner.com/2010/08/23/readme-driven-development)
+[Make a README](https://www.makeareadme.com/)
+[Choose a LICENSE](https://choosealicense.com/)
+ +## License +This project is licensed under MIT - see the [LICENSE](LICENSE) file for details. diff --git a/include/platform.h b/include/platform.h new file mode 100644 index 0000000..91954c6 --- /dev/null +++ b/include/platform.h @@ -0,0 +1,7 @@ +#ifndef PLATFORM_H +#define PLATFORM_H + +void platform_print(void); + +#endif + diff --git a/src/linux_platform.c b/src/linux_platform.c new file mode 100644 index 0000000..4508410 --- /dev/null +++ b/src/linux_platform.c @@ -0,0 +1,8 @@ +#include "../include/platform.h" +#include + +void platform_print(void) +{ + printf("Linux platform\n"); +} + diff --git a/src/win32_platform.c b/src/win32_platform.c new file mode 100644 index 0000000..63605a5 --- /dev/null +++ b/src/win32_platform.c @@ -0,0 +1,7 @@ +#include "../include/platform.h" +#include + +void platform_print(void) +{ + printf("Windows platform\n"); +} diff --git a/tests/main.c b/tests/main.c new file mode 100644 index 0000000..207b8ac --- /dev/null +++ b/tests/main.c @@ -0,0 +1,8 @@ +#include "../include/platform.h" + +int main(void) +{ + platform_print(); + return 0; +} +