-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 732 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 732 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
31
32
33
34
35
PREFIX ?= /usr/local
TARGET = garcon
LIBS = -lm
CFLAGS = -D_GNU_SOURCE -std=gnu99 -Wall -Wextra # -Werror -Os
LDFLAGS = -D_GNU_SOURCE -std=gnu99
# CFLAGS = -D_POSIX_C_SOURCE=200112L -std=c99 -Wall -Wextra # -Werror -Os
INC = -Ideps
.PHONY: default all clean install uninstall
default: $(TARGET)
all: default
OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c) $(wildcard deps/*/*.c))
HEADERS = $(wildcard *.h)
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) $(INC) -c $< -o $@
.PRECIOUS: $(TARGET) $(OBJECTS)
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -Wall $(LIBS) -o $@
clean:
-rm -f *.o
-rm -f deps/*/*.o
-rm -f $(TARGET)
install: $(TARGET)
cp -f $(TARGET) $(PREFIX)/bin/$(TARGET)
uninstall:
rm -f $(PREFIX)/bin/$(TARGET)