summaryrefslogtreecommitdiff
path: root/Makefile
blob: c41f3196b0a7bb2af143d044285783e4e00bdd06 (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
36
37
38
39
40
41
42
43
44
CC = gcc -m32
LD = gcc -m32
AR = ar rcs

CPPFLAGS = -g -Wall -Werror -D_FILE_OFFSET_BITS=64 -I.
LDFLAGS = -g -lz

SOURCE_LIST = \
errors.c \
lookupa.c \
hashtab.c \
recycle.c \
mpq-bios.c \
mpq-crypto.c \
mpq-errors.c \
mpq-file.c \
mpq-fs.c \
mpq-misc.c \
stalloc.c \


TARGET = mpqlib.a


OBJ_LIST = $(addsuffix .o, $(notdir $(basename $(SOURCE_LIST))))
DEP_LIST = $(addsuffix .dep, $(notdir $(basename $(SOURCE_LIST))))

all: dep $(TARGET)

$(TARGET): $(OBJ_LIST)
	$(AR) $@ $(OBJ_LIST)

test-it: $(TARGET) test-it.o
	$(LD) -o test-it test-it.o $(TARGET) $(LDFLAGS)

clean:
	rm -f *.o *.dep $(TARGET) test-it

dep: $(DEP_LIST)

%.dep : %.c
	$(CC) $(CPPFLAGS) -M -MF $@ $<

-include $(DEP_LIST)