-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (24 loc) · 1018 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (24 loc) · 1018 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
30
# Makefile for the "FRAKEN" TTSM system monitor program on FreeBSD
# Variables
# When we're done, we should prune this to make it look like I actually
# know what it is that I'm doing. -Fraken.
CC = cc
#add -Ofast to the CFLAGS list or one of the other -blah to improve speed. -Fraken.
# You can remove ALL -O flags if you want though. No worries. :)
# Let's also try -march=native, -ffast-math, -finline-functions
CFLAGS = -Wall -Wextra -I/usr/local/include
LDFLAGS = -lpthread -ldevstat -I/usr/local/include -L/usr/local/lib -lX11
SOURCES = main.c cpu.c network.c disk.c swap.c globals.c graphics.c
OBJECTS = $(SOURCES:.c=.o)
EXECUTABLE = ttsm
# Default target: builds the executable
all: $(EXECUTABLE)
# Rule to link the object files into the final executable
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) -o $(EXECUTABLE) $(LDFLAGS)
# Rule to compile each .c file into a .o object file
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean target: removes the compiled files
clean:
rm -f $(OBJECTS) $(EXECUTABLE)