From 85c20db9b2eeef8bd8d8ada58f9ff486c50f9706 Mon Sep 17 00:00:00 2001 From: vx-clutch Date: Fri, 27 Mar 2026 15:38:41 -0400 Subject: [PATCH] first commit remove bin wip --- LICENSE | 15 +++++++++++++++ Makefile | 33 +++++++++++++++++++++++++++++++++ README | 23 +++++++++++++++++++++++ config.mk | 12 ++++++++++++ src/frcctrlmgr.c | 22 ++++++++++++++++++++++ src/frcctrlmgr.h | 12 ++++++++++++ 6 files changed, 117 insertions(+) create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README create mode 100644 config.mk create mode 100644 src/frcctrlmgr.c create mode 100644 src/frcctrlmgr.h diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8990af7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2026 vxc + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9c36e9b --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +include config.mk + +SRC = src/frcctrlmgr.c +OBJ = $(SRC:.c=.o) +BIN = frcctrlmgr +DIST = $(BIN)-$(VERSION) + +all: $(BIN) + +$(BIN): $(OBJ) + $(LD) $(LDFLAGS) -o $@ $(OBJ) + +.c.o: + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ + +install: $(BIN) + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin/$(BIN) + chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN) + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN) + +clean: + rm -f $(OBJ) $(BIN) $(DIST).tar.gz + +dist: clean + mkdir -p $(DIST) + cp -R src config.mk Makefile $(DIST) + tar -czf $(DIST).tar.gz $(DIST) + rm -rf $(DIST) + +.PHONY: all install uninstall clean dist diff --git a/README b/README new file mode 100644 index 0000000..68412f4 --- /dev/null +++ b/README @@ -0,0 +1,23 @@ +frcctrlmgr - FRC Control Manager +================================ + +frcctrlmgr is a fast and simple tool for generating reference documents of your +control scheme. + +Why? +---- + +I wanted to have an easy way to visualize the controls. + +How? +---- + +The main way to use this is to invoke in the shell with the root of the +project. i.e. + + frcctrlmgr . + frcctrlmgr path/to/project/ + +This is tested on the Adambots 2026 repository. + +[1] https://github.com/Adambots245/Adambots2026 diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..63eb805 --- /dev/null +++ b/config.mk @@ -0,0 +1,12 @@ +# frcctrlmgr version +VERSION = 0.1 + +# paths +PREFIX = /usr/local +MANPREFIX = $(PREFIX)/share/man + +CC = cc +LD = $(CC) +CPPFLAGS = +CFLAGS = -Wextra -Wall -Os +LDFLAGS = -s diff --git a/src/frcctrlmgr.c b/src/frcctrlmgr.c new file mode 100644 index 0000000..503cea1 --- /dev/null +++ b/src/frcctrlmgr.c @@ -0,0 +1,22 @@ +#include "frcctrlmgr.h" + +char *argv0; + +void usage(int code) { + printf("usage: %s: [-h help] [-v]\n", argv0); + exit(code); +} + +int main(int argc, char *argv[]) { + argv0 = argv[0]; + + for (int i = 0; i < argc; ++i) { + if (STRCMP("--help")) + usage(0); + if (STRCMP("-h")) + usage(0); + if (STRCMP("-v")) + printf("%s/%s\n", argv0, VERSION); + } + return 0; +} diff --git a/src/frcctrlmgr.h b/src/frcctrlmgr.h new file mode 100644 index 0000000..ab29a0a --- /dev/null +++ b/src/frcctrlmgr.h @@ -0,0 +1,12 @@ +#ifndef FRCCTRLMGR_H_ +#define FRCCTRLMGR_H_ + +#define VERSION "0.1" + +#include +#include +#include + +#define STRCMP(x) !strcmp(argv[i], x) + +#endif // FRCTRLMGR_H_