first commit

remove bin

wip
This commit is contained in:
2026-03-27 15:38:41 -04:00
committed by vx-clutch
commit 85c20db9b2
6 changed files with 117 additions and 0 deletions

15
LICENSE Normal file
View File

@@ -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.

33
Makefile Normal file
View File

@@ -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

23
README Normal file
View File

@@ -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

12
config.mk Normal file
View File

@@ -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

22
src/frcctrlmgr.c Normal file
View File

@@ -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;
}

12
src/frcctrlmgr.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef FRCCTRLMGR_H_
#define FRCCTRLMGR_H_
#define VERSION "0.1"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STRCMP(x) !strcmp(argv[i], x)
#endif // FRCTRLMGR_H_