File: Makefile

package info (click to toggle)
uhexen2 1.5.6+dfsg-1
  • links: PTS
  • area: contrib
  • in suites: jessie, jessie-kfreebsd
  • size: 16,340 kB
  • ctags: 23,477
  • sloc: ansic: 188,956; asm: 14,958; makefile: 3,475; sh: 3,325; objc: 330; pascal: 213; cpp: 19
file content (70 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# GNU Makefile for the H2PATCH tool - Unix platforms.
# $Id: Makefile 5030 2013-01-03 18:28:36Z sezero $
#
# To build a debug version:		make DEBUG=yes
#

UHEXEN2_TOP:=..
UHEXEN2_SHARED:=$(UHEXEN2_TOP)/common
LIBS_DIR:=$(UHEXEN2_TOP)/libs
OSLIBS:=$(UHEXEN2_TOP)/oslibs

CC ?= gcc
ifeq ($(origin CC),default)
# refuse the stupid 'cc' default of make
# which not necessarily exist everywhere
CC  = gcc
endif
LINKER = $(CC)

CPUFLAGS=
CFLAGS  += -g -Wall
CFLAGS += $(CPUFLAGS)
ifndef DEBUG
CFLAGS += -O2 -DNDEBUG=1
endif
LDFLAGS +=

XDELTA_DIR:= $(LIBS_DIR)/xdelta3
XDFLAGS:= -DXD3_DEBUG=0
# when XD3_USE_LARGEFILE64 is not defined, xdelta3 defaults
# to 64 bit xoff_t.
# define XD3_USE_LARGEFILE64 as 0 or 1.
XDFLAGS+= -DXD3_USE_LARGEFILE64=1
# make xdelta3 to use stdio:
XDFLAGS+= -DXD3_STDIO=1
XDFLAGS+= -I$(XDELTA_DIR) -I$(UHEXEN2_SHARED)
XDFLAGS+= $(CFLAGS)

CFLAGS  += -I. -I$(XDELTA_DIR) -I$(UHEXEN2_SHARED)

TARGETS:= h2patch

# Targets
.PHONY: clean distclean

all: $(TARGETS)

OBJECTS:= xdelta3.o qsnprint.o h2patch3.o

XD3DEPS:= xdelta3-decode.h xdelta3-list.h xdelta3-main.h xdelta3-blkcache.h \
	xdelta3.c xdelta3.h
XD3DEPS:= $(patsubst %,$(XDELTA_DIR)/%,$(XD3DEPS))

# Rules for turning source files into .o files
%.o: %.c
	$(CC) -c $(CFLAGS) -o $@ $<
%.o: $(UHEXEN2_SHARED)/%.c
	$(CC) -c $(CFLAGS) -o $@ $<

xdelta3.o: $(XD3DEPS)
	$(CC) $(XDFLAGS) -c $(XDELTA_DIR)/xdelta3.c -o xdelta3.o

h2patch: $(OBJECTS)
	$(LINKER) $(OBJECTS) $(LDFLAGS) -o $@

clean:
	rm -f *.o *.res
distclean: clean
	rm -f $(TARGETS)