-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (46 loc) · 1.08 KB
/
Makefile
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
45
46
47
48
49
50
51
52
PREFIX =
CC = $(PREFIX)gcc
SRC = \
src/argps.c \
src/argpus.c \
src/bsearch.c \
src/cvutf8.c \
src/getopt.c \
src/hmd5.c \
src/http.c \
src/parser.c \
src/sax.c \
src/tchar.c \
src/tr64c.c \
src/url.c \
src/utf8.c
SYS := $(shell $(CC) -dumpmachine)
ifneq (, $(findstring linux, $(SYS)))
include src/linux.mk
else
ifneq (, $(findstring mingw, $(SYS))$(findstring windows, $(SYS)))
include src/mingw.mk
else
include src/general.mk
endif
endif
all: bin bin/tr64c$(BINEXT)
.PHONY: clean
clean:
ifeq (,$(strip $(WINDRES)))
rm -f bin/tr64c$(BINEXT)
else
rm -f bin/tr64c$(BINEXT) bin/version$(OBJEXT)
endif
bin:
mkdir bin
.PHONY: bin/tr64c$(BINEXT)
bin/tr64c$(BINEXT): $(SRC)
ifeq (,$(strip $(WINDRES)))
rm -f $@
$(CC) $(CFLAGS) -DBACKEND_$(BACKEND) $(CWFLAGS) $(PATHS) $(LDFLAGS) -o $@ $+ $(LIBS)
else
rm -f $@ bin/tr64c$(OBJEXT)
$(WINDRES) -DBACKEND_$(BACKEND) src/version.rc bin/version$(OBJEXT)
$(CC) $(CFLAGS) -DBACKEND_$(BACKEND) $(CWFLAGS) $(PATHS) $(LDFLAGS) -o $@ $+ bin/version$(OBJEXT) $(LIBS)
endif