-
Notifications
You must be signed in to change notification settings - Fork 156
/
rules.make
171 lines (128 loc) · 3.64 KB
/
rules.make
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#
# This file contains rules which are shared among multiple platforms.
# used for makefile.ng
#
# ------> Please changes to your own rules specific to platform. <------
TARGET_RULES=build/rules-pc.linux
# ----------------------------------------------------------------------
include $(abs_top_srcdir)/$(TARGET_RULES)
# Common rules definitions for building MiniGUI with GNU Make
# Flags that can be set on the nmake command line:
# DEBUG=1 for compiling a debugging version
# PREFIX=Some/Directory Base directory for installation
ifndef DEBUG
DEBUG=0
endif
ifndef PREFIX
PREFIX = c:/usr
endif
# Directories used by "make install":
prefix = $(PREFIX)
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
datadir = $(prefix)/share
localedir = $(datadir)/locale
mandir = $(datadir)/man
docdir = $(datadir)/doc/minigui
# The directory where the include files will be installed
libminiguiincludedir = $(includedir)/minigui
# Programs used by "make":
CP = cp
LN = cp
RM = rm -f
# Programs used by "make install":
INSTALL = cp
INSTALL_PROGRAM = cp
INSTALL_DATA = cp
ifndef DEPLIBDIR
DEPLIBDIR=$(PREFIX)
endif
######################################################################
#DIRENT_CFLAGS = -Ibuild/win32/dirent
#DIRENT_LIBS = build/win32/dirent/dirent.lib
# Don't know if Freetype2, FriBiDi and some others actually can be
# built with MSVC, but one can produce an import library even if the
# DLL was built with gcc.
FREETYPE2_CFLAGS = -I $(FREETYPE2)/include
FREETYPE2_LIBS = $(FREETYPE2)/obj/freetype-$(FREETYPE2_VER).lib
JPEG_CFLAGS = -I $(JPEG)
JPEG_LIBS = $(JPEG)/jpeg.lib
OPENGL_CFLAGS = # None needed, headers bundled with the compiler
OPENGL_LIBS = opengl32.lib lglu32.lib
PNG_CFLAGS = -I $(DEPLIBDIR)
PNG_LIBS = $(DEPLIBDIR)/lib/png.lib
ifndef NOTHREAD
PTHREAD_CFLAGS = -I $(DEPLIBDIR)/include
PTHREAD_LIBS = $(DEPLIBDIR)/lib/pthreadVC1.lib
else
PTHREAD_CFLAGS =
PTHREAD_LIBS =
endif
TIFF_CFLAGS = -I $(TIFF)/libtiff
# Use single import library for both libtiff DLL versions (with or
# without LZW code). The user selects which DLL to use.
TIFF_NOLZW_LIBS = $(TIFF)/libtiff/tiff.lib $(JPEG_LIBS) $(ZLIB_LIBS) user32.lib
TIFF_LZW_LIBS = $(TIFF_NOLZW_LIBS)
TIFF_LIBS = $(TIFF_NOLZW_LIBS)
ZLIB_CFLAGS = -I $(ZLIB)
ZLIB_LIBS = $(ZLIB)/zlib.lib
#################################################################################
ifdef LOCAL_INC
INCLUDES = $(LOCAL_INC)
endif
ifndef OBJ
OBJ=o
endif
ifndef LIBA
LIBA=a
endif
#################################################################################
DEPLIBINC = -I$(DEPLIBDIR)/include
CFLAGS += $(OPTIMIZE) $(DEBUGINFO) $(DEPLIBINC) $(DEFINES) $(DEPCFLAGS) -c
DEFS += -D__MINIGUI_LIB__ -D_REENTRANT
CFLAGS += -I$(abs_top_srcdir) -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/include $(INCLUDES) $(DEFS) $(INCS)
%.$(OBJ): %.c
$(CC) $(CFLAGS) $(COFLAG) $<
ifdef SRC_FILES
OBJ_FILES=$(SRC_FILES:.c=.$(OBJ))
endif
######################################################################
default : all
all :: makefile.ng
ifdef LIB_NAME
all :: $(LIB_NAME).$(LIBA)
endif
$(LIB_NAME).$(LIBA):$(OBJ_FILES)
$(AR) $(ARFLAGS) $(ARFLAGS_OUT)$@ $^
@$(RANLIB) $@
clean::
@-$(RM) *.$(OBJ)
@-$(RM) *.$(LIBA)
ifeq ($(CC), cl)
@-$(RM) *.dll
@-$(RM) *.exe
@-$(RM) *.res
@-$(RM) *.i
@-$(RM) *.err
@-$(RM) *.map
@-$(RM) *.sym
@-$(RM) *.exp
@-$(RM) *.lk1
@-$(RM) *.mk1
@-$(RM) *.pdb
@-$(RM) *.ilk
endif
ifeq (1, $(TOPLOOP))
install :: installdirs
clean install ::
ifdef SUB_DIRS
@for i in $(SUB_DIRS); do $(MAKE) -C $$i -f makefile.ng $@; done
endif
all::
@for i in $(SUB_DIRS); do $(MAKE) -C $$i -f makefile.ng $@; done
else
install :: force
endif
force: