blob: 1934910adc6543dc1e969687a8f59062fe170593 (
plain)
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
|
# Debug mode:
# DEBUG = yes
CC = gcc
LIB = libmagi.a
CFLAGS = -xc -ansi -pedantic -Wall
ifeq '$(DEBUG)' 'yes'
CFLAGS += -g -O0
else
CFLAGS += -O3
endif
SRC_DIR = src
SRC = $(wildcard $(SRC_DIR)/*.c)
OBJ = $(SRC:.c=.o)
default: $(LIB)
ifneq "clean" "$(MAKECMDGOALS)"
-include deps.mk
endif
deps.mk: $(SRC)
$(CC) -MM $^ > $@
%.o: %.c %.h
$(CC) $(CFLAGS) -c $< -o $@
$(LIB): $(OBJ)
ar rcs $@ $^
clean:
rm -f $(OBJ) $(LIB) deps.mk
|