first commit
This commit is contained in:
15
LICENSE
Normal file
15
LICENSE
Normal 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.
|
||||
30
Makefile
Normal file
30
Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
include config.mk
|
||||
|
||||
OBJ = src/frcctrlmgr.o
|
||||
BIN = frcctrlmgr
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS)
|
||||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
|
||||
rm -f $(DESTDIR)$(MANPREFIX)/man8/$(BIN).8
|
||||
|
||||
dist: clean
|
||||
mkdir -p frcctrlmgr-$(VERSION)
|
||||
cp LICENSE Makefile README config.mk src/frcctrlmgr.c src/frcctrlmgr.h frcctrlmgr-$(VERSION)
|
||||
tar -cf frcctrlmgr-$(VERSION).tar frcctrlmgr-$(VERSION)
|
||||
gzip frcctrlmgr-$(VERSION).tar
|
||||
rm -rf frcctrlmgr-$(VERSION)
|
||||
|
||||
clean:
|
||||
rm -f $(BIN) $(OBJ) frcctrlmgr-$(VERSION).tar.gz
|
||||
|
||||
.PHONY:
|
||||
all install uninstall dist clean
|
||||
23
README
Normal file
23
README
Normal 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
12
config.mk
Normal 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
|
||||
BIN
frcctrlmgr
Executable file
BIN
frcctrlmgr
Executable file
Binary file not shown.
22
src/frcctrlmgr.c
Normal file
22
src/frcctrlmgr.c
Normal 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;
|
||||
}
|
||||
11
src/frcctrlmgr.h
Normal file
11
src/frcctrlmgr.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef FRCCTRLMGR_H_
|
||||
#define FRCCTRLMGR_H_
|
||||
|
||||
#define VERSION "0.1"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define STRCMP(x) !strcmp(argv[i], x)
|
||||
|
||||
#endif // FRCTRLMGR_H_
|
||||
BIN
src/frcctrlmgr.o
Normal file
BIN
src/frcctrlmgr.o
Normal file
Binary file not shown.
Reference in New Issue
Block a user