-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (54 loc) · 1.73 KB
/
Makefile
File metadata and controls
67 lines (54 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# cspaced - C Indented Language Transpiler
# Makefile for building the cspaced CLI tool
CC=tcc
CFLAGS=-Iinclude -Wall -Wextra -g
LDFLAGS=-lm
# Source files
SOURCES=src/main.c src/lexer.c src/parser.c src/transpiler.c src/compiler.c
HEADERS=include/lexer.h include/parser.h include/transpiler.h include/compiler.h
TARGET=cspaced
# Default target
all: $(TARGET)
# Main binary
$(TARGET): $(SOURCES) $(HEADERS)
$(CC) $(CFLAGS) -o $(TARGET) $(SOURCES) $(LDFLAGS)
# Debug build
debug: CFLAGS += -O0 -DDEBUG
debug: $(TARGET)
# Release build
release: CFLAGS += -O2 -DNDEBUG
release: $(TARGET)
# Install
install: $(TARGET)
install -m 755 $(TARGET) /usr/local/bin/
# Uninstall
uninstall:
rm -f /usr/local/bin/$(TARGET)
# Clean
clean:
rm -f $(TARGET) *.o
# Test - basic functionality
test: $(TARGET)
@echo "Running basic tests..."
@echo 'int main(void):' > test.csp
@echo ' printf("Hello cspaced!\n")' >> test.csp
@echo ' return 0' >> test.csp
./$(TARGET) test.csp
@if [ -f test.c ]; then echo "✓ Transpilation successful"; else echo "✗ Transpilation failed"; fi
@rm -f test.c test.csp
# Documentation
docs: LANGUAGE_SPEC.md
@echo "Language specification: LANGUAGE_SPEC.md"
# Show all available targets
help:
@echo "Available targets:"
@echo " all - Build cspaced (default)"
@echo " debug - Build with debug symbols"
@echo " release - Build optimized release"
@echo " test - Run basic tests"
@echo " clean - Remove build artifacts"
@echo " install - Install to /usr/local/bin"
@echo " uninstall - Remove from /usr/local/bin"
@echo " docs - Show documentation"
@echo " help - Show this help message"
.PHONY: all debug release install uninstall clean test docs help