forked from x42/harvid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mak
56 lines (50 loc) · 1.3 KB
/
common.mak
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
VERSION?=$(shell git describe --tags HEAD || echo "X.X.X")
CFLAGS ?= -Wall -g -O2
PREFIX ?= /usr/local
bindir ?= $(PREFIX)/bin
mandir ?= $(PREFIX)/share/man
libdir ?= $(PREFIX)/lib
docdir ?= $(PREFIX)/share/doc
includedir ?= $(PREFIX)/include
man1dir ?= $(mandir)/man1
hdocdir ?= $(docdir)/harvid
ECHO=$(shell which echo) -e
ARCHFLAGS=
ARCHINCLUDES=
ARCHLIBES=
LIBEXT=so
ifeq ($(ARCH),mingw)
CC=i686-w64-mingw32-gcc
LD=i686-w64-mingw32-ld
AR=i686-w64-mingw32-ar
NM=i686-w64-mingw32-nm -B
RANLIB=i686-w64-mingw32-ranlib
STRIP=i686-w64-mingw32-strip
WINEROOT?=$(HOME)/.wine/drive_c/x-prefix
PKG_CONFIG_PATH=$(WINEROOT)/lib/pkgconfig/
ARCHINCLUDES=-I$(WINEROOT)/include -DHAVE_WINDOWS
ARCHLIBES=-lwsock32 -lws2_32 -lpthreadGC2
LDFLAGS+=-L$(WINEROOT)/lib/ -L$(WINEROOT)/bin
UNAME=mingw
LIBEXT=dll
else
RANLIB=ranlib
STRIP=strip
NM=nm
UNAME=$(shell uname)
ifeq ($(UNAME),Darwin)
ARCHFLAGS=-arch i386 -arch ppc -arch x86_64
ARCHFLAGS+=-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5
ARCHFLAGS+=-headerpad_max_install_names
ARCHLIBES+=-sectcreate __DATA __doc_harvid_jpg ../doc/harvid.jpg
ARCHLIBES+=-sectcreate __DATA __doc_seek_js ../doc/seek.js
LOGODEP=
ECHO=echo
LIBEXT=dylib
NM=nm
else
ARCHLIBES=-lrt -lpthread
LIBEXT=so
NM=nm -B
endif
endif