-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
55 lines (41 loc) · 1.12 KB
/
makefile
File metadata and controls
55 lines (41 loc) · 1.12 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
# Group No: 15
# Group members:
# 1. Shivodit Raj Vishnoi - 2022A7PS1221P
# 2. Parsewar Omkar Balaji - 2022A7PS0089P
# 3. Samiksha Kaul - 2022A7PS1169P
# 4. Sohan Reddy Jalakanti - 2022A7PS1177P
# 5. Arnav Gupta - 2022A7PS1189P
# 6. Akshat Gosain - 2022A7PS0154G
# Compiler
CC = gcc
# Compiler flags
CFLAGS = -Wall -Wextra -g -O2
# Libraries
LDLIBS = -lm
# Source files
SRCS = driver.c lexer.c helper_function.c symbol_table.c parser.c stack.c parseTree.c
# Header files
HDRS = lexer.h lexerDef.h helper_function.h symbol_table.h symbol_tableDef.h \
parser.h parserDef.h stack.h stackDef.h parseTree.h parseTreeDef.h
# Object files
OBJS = $(SRCS:.c=.o)
# Executable
EXEC = compiler
# Default target
all: $(EXEC)
# Link object files to create the executable
$(EXEC): $(OBJS)
$(CC) $(CFLAGS) -o $(EXEC) $(OBJS) $(LDLIBS)
# Compile source files into object files
%.o: %.c $(HDRS)
$(CC) $(CFLAGS) -c $< -o $@
# Clean up object files and executable
clean:
rm -f $(OBJS) $(EXEC)
# Clean up all generated files
distclean: clean
rm -f *~ *.bak
# Run the executable
run: $(EXEC)
./$(EXEC) $(f1) $(f2)
.PHONY: all clean distclean run