diff options
| -rw-r--r-- | Makefile | 58 | ||||
| -rw-r--r-- | src/headers/abstract.h (renamed from headers/abstract.h) | 0 | ||||
| -rw-r--r-- | src/headers/codegen.h (renamed from headers/codegen.h) | 0 | ||||
| -rw-r--r-- | src/headers/freeast.h (renamed from headers/freeast.h) | 0 | ||||
| -rw-r--r-- | src/headers/kat.h (renamed from headers/kat.h) | 0 | ||||
| -rw-r--r-- | src/rbc.c (renamed from rbc.c) | 0 |
6 files changed, 58 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6243fb3 --- /dev/null +++ b/Makefile @@ -0,0 +1,58 @@ +CC = cc +# Release options +CFLAGS = -Wall -Wextra -pedantic -O2 +TARGET = build/crbc +# Debug options +DEBUG_CFLAGS = -Wall -Wextra -pedantic -O0 -fsanitize=address,undefined -g +DEBUG_TARGET = debug/crbc +# Source +SRC = src/rbc.c +# Install targets +PREFIX ?= /usr/local +BINDIR = $(PREFIX)/bin +INSTALL_TARGET = crbc +INSTALL_DEBUG_TARGET = $(INSTALL_TARGET)_debug + +# Compile all +All: + $(CC) $(CFLAGS) $(SRC) -o $(TARGET) + $(CC) $(DEBUG_CFLAGS) $(SRC) -o $(DEBUG_TARGET) + +# Compile release (same as 'make') +Release: + $(CC) $(CFLAGS) $(SRC) -o $(TARGET) + +# Compile debug +Debug: + $(CC) $(DEBUG_CFLAGS) $(SRC) -o $(DEBUG_TARGET) + +# Clean all (release + debug) +cleanall: + rm -f $(TARGET) + rm -f $(DEBUG_TARGET) + +# Clean release +CleanRelease: + rm -f $(TARGET) + +# Clean debug +CleanDebug: + rm -f $(DEBUG_TARGET) + +# Install all (release + debug) +Install: + install -Dm755 $(INSTALL_TARGET) $(BINDIR)/crbc + install -Dm755 $(INSTALL_DEBUG_TARGET) $(BINDIR)/crbc + +# Install release +InstallRelease: + install -Dm755 $(INSTALL_TARGET) $(BINDIR)/crbc + +# Install debug +InstallDebug: + install -Dm755 $(INSTALL_DEBUG_TARGET) $(BINDIR)/crbc + +# Uninstall all +Uninstall: + rm -f $(BINDIR)/$(INSTALL_TARGET) + rm -f $(BINDIR)/$(INSTALL_DEBUG_TARGET) diff --git a/headers/abstract.h b/src/headers/abstract.h index efecaa0..efecaa0 100644 --- a/headers/abstract.h +++ b/src/headers/abstract.h diff --git a/headers/codegen.h b/src/headers/codegen.h index d629caf..d629caf 100644 --- a/headers/codegen.h +++ b/src/headers/codegen.h diff --git a/headers/freeast.h b/src/headers/freeast.h index 544d183..544d183 100644 --- a/headers/freeast.h +++ b/src/headers/freeast.h diff --git a/headers/kat.h b/src/headers/kat.h index f5a3a00..f5a3a00 100644 --- a/headers/kat.h +++ b/src/headers/kat.h |