/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-02 15:50:53 UTC
  • Revision ID: edam@waxworlds.org-20100202155053-pzlmflt7vq1q9ya9
- a file names 'subdir.mk' in subdirectories mentioned in the SUBDIRS variable is now explicitly used during the making the subdirectory, if it is present
- used line breaks for long lines, rather than multiple variable definitions
- added extra warnings for C++ compilation
- create position independant code in static libs as well as shared
- also clean *~ files

Show diffs side-by-side

added added

removed removed

86
86
#
87
87
# SUBDIRS      A list of subdirectories to build before attempting to build the
88
88
#              target. These subdirectories are also included in a clean_all.
89
 
#              Note that if the file 'emake.mk' exists in a subdirectory, it
 
89
#              Note that if the file 'subdir.mk' exists in a subdirectory, it
90
90
#              will be used explicitly, rather than any default makefile.
91
91
#
92
92
# SUBPROJS     A list of the names of other makefiles to run before attempting
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)
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
 
262
256
$(SUBDIRS) $(SUBPROJS):
263
257
        @if [ "$@" = "$(firstword $(SUBDIRS) $(SUBPROJS))" ]; then echo; fi
264
258
        @$(MAKE) $(if $(filter $@,$(SUBPROJS)), -f $@.mk, \
265
 
                -C $@ $(if $(wildcard $@/emake.mk),-f emake.mk,)) \
 
259
                -C $@ $(if $(wildcard $@/subdir.mk),-f subdir.mk,)) \
266
260
                $(filter-out $(SUBDIRS) $(SUBPROJS) subdirs subprojs,$(MAKECMDGOALS))
267
261
        @echo
268
262