/make/edam-mk

To get this branch, use:
bzr branch http://bzr.ed.am/make/edam-mk

« back to all changes in this revision

Viewing changes to edam.mk

  • Committer: edam
  • Date: 2010-02-08 19:36:44 UTC
  • Revision ID: edam@waxworlds.org-20100208193644-hdddr0bl0y42jib7
Tags: 3.4
- changed name of makefile used in subdirs to emake.mk

Show diffs side-by-side

added added

removed removed

2
2
#
3
3
#                       edam's general-purpose makefile
4
4
#_______________________________________________________________________________
5
 
#                                                                    version 3.5
 
5
#                                                                    version 3.4
6
6
#
7
7
# Copyright (c) 2009 Tim Marston <edam@waxworlds.org>.
8
8
#
119
119
# run          Builds the target of your Makefile and, if successful, runs it.
120
120
#              This is not available if you're building a library of some kind.
121
121
#
122
 
# debug        The same as the run goal, except instead of running the target,
123
 
#              it is debugged with gdb.
124
 
#
125
122
# clean        Deletes temporary files.
126
123
#
127
124
# clean_all    Deletes temporary files and then goes through then project's
161
158
 
162
159
# debug/profile build flags
163
160
CPPFLAGS        := $(if $(PROFILEMODE),-pg -D PROFILE) $(if $(DEBUGMODE),\
164
 
        -g3 -D DEBUG -Wall -Wextra,-D NDEBUG -O2) $(CPPFLAGS)
 
161
        -g -D DEBUG -Wall -Wextra,-D NDEBUG -O2) $(CPPFLAGS)
165
162
CXXFLAGS        := $(if $(DEBUGMODE),-Woverloaded-virtual -Wreorder \
166
163
        -Wctor-dtor-privacy) $(CXXFLAGS)
167
164
DFLAGS          := $(if $(DEBUGMODE),,-frelease)
174
171
LDFLAGS         := $(if $(LINKSTATIC),-static) $(LDFLAGS)
175
172
 
176
173
# add libraries for d
177
 
LIBRARIES       := $(LIBRARIES) $(if $(filter %.d, $(SOURCES)), gphobos2 rt)
 
174
LIBRARIES       := $(LIBRARIES) $(if $(filter %.d, $(SOURCES)), gphobos pthread m)
178
175
 
179
176
# build flags for libraries
180
177
LDPOSTFLAGS := $(addprefix -l,$(LIBRARIES)) $(LDPOSTFLAGS)
227
224
#_______________________________________________________________________________
228
225
#                                                                          RULES
229
226
 
230
 
.PHONY: all subdirs subprojs target clean clean_all run debug depend dep \
 
227
.PHONY: all subdirs subprojs target clean clean_all run depend dep \
231
228
        $(SUBDIRS) $(SUBPROJS)
232
229
 
233
230
all: subdirs subprojs target
253
250
ifndef MKSHAREDLIB
254
251
run: target
255
252
        ./$(TARGET)
256
 
 
257
 
debug: target
258
 
        gdb ./$(TARGET)
259
253
endif
260
254
endif
261
255