-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 729 Bytes
/
Copy pathMakefile
File metadata and controls
29 lines (23 loc) · 729 Bytes
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
# Compiler and compiler flags
CC=gcc
CFLAGS=-Wall -g
SQLITE_LIB=-lsqlite3
PTHREAD_LIB=-lpthread
# Find all .c files in the current directory
SOURCES=$(wildcard *.c)
# Determine the executable names for each source file
EXECUTABLES=$(SOURCES:.c=)
# Default target to build all executables
all: $(EXECUTABLES)
# Rule to compile each source file to an executable
%: %.c
$(CC) $(CFLAGS) -o $@ $<
# Special rule for SQL_injection to link the SQLite library
SQL_injection: SQL_injection.c
$(CC) $(CFLAGS) -o $@ $< $(SQLITE_LIB)
# Special rule for race_condition to link the pthread library
race_condition: race_condition.c
$(CC) $(CFLAGS) -o $@ $< $(PTHREAD_LIB)
# Clean up the built executables
clean:
rm -f $(EXECUTABLES)