Commit | Line | Data |
---|---|---|
731a470e JB |
1 | TARGET = exo2 |
2 | LIBS = | |
3 | CC = gcc | |
4 | # Enforce C11 ISO standard for now | |
edbb50f7 JB |
5 | CFLAGS = -std=c11 -g -Wall -Wextra |
6 | LDFLAGS = -g -Wall -Wextra | |
731a470e JB |
7 | |
8 | .PHONY: default all clean | |
9 | ||
10 | default: $(TARGET) | |
11 | all: default | |
12 | ||
13 | OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) | |
14 | HEADERS = $(wildcard *.h) | |
15 | ||
16 | %.o: %.c $(HEADERS) | |
17 | $(CC) $(CFLAGS) -c $< -o $@ | |
18 | ||
19 | .PRECIOUS: $(TARGET) $(OBJECTS) | |
20 | ||
21 | $(TARGET): $(OBJECTS) | |
22 | $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@ | |
23 | ||
24 | clean: | |
25 | -rm -f $(TARGET) $(OBJECTS) | |
26 | ||
27 | disassemble: $(TARGET) | |
28 | objdump -d $< | less | |
29 | ||
30 | symbols: $(TARGET) | |
31 | objdump -t $< | sort | less |