diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-08-07 14:06:00 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-11-24 08:56:54 -0500 |
| commit | 7ed25faa26fc3718aadbfe41b0ccd8f853063db3 (patch) | |
| tree | a2ab6f839c5237b1bdbd1fbfbbc2b2945f9d6395 /native | |
| parent | 6e7c15480d7f5e57636d5648c97c4277eea2c704 (diff) | |
Cleanup native/ Makefile
- Normalize line endings.
- Introduce DEFS variable to allow user to specify definitions in .config.
- Add -Werror to avoid accumulating warnings.
Diffstat (limited to 'native')
| -rw-r--r-- | native/Makefile | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/native/Makefile b/native/Makefile index 80c8310..9ae543a 100644 --- a/native/Makefile +++ b/native/Makefile | |||
| @@ -19,6 +19,7 @@ DISABLED_WARNINGS += -Wno-deprecated # We still use ext::hash_map<>. | |||
| 19 | 19 | ||
| 20 | INCLUDES = -Iinclude -I${GMP_PATH}/include | 20 | INCLUDES = -Iinclude -I${GMP_PATH}/include |
| 21 | LIBS = -L${GMP_PATH}/lib -lgmp -lgmpxx | 21 | LIBS = -L${GMP_PATH}/lib -lgmp -lgmpxx |
| 22 | DEFS ?= | ||
| 22 | 23 | ||
| 23 | OS := $(shell uname) | 24 | OS := $(shell uname) |
| 24 | 25 | ||
| @@ -41,16 +42,17 @@ ifeq ($(OS),Linux) | |||
| 41 | LIBS += -lrt | 42 | LIBS += -lrt |
| 42 | endif | 43 | endif |
| 43 | 44 | ||
| 44 | CXXFLAGS = -Wall -Wextra $(DISABLED_WARNINGS) -fPIC $(INCLUDES) | ||
| 45 | LDFLAGS = $(LIBS) | ||
| 46 | SWIGFLAGS = -python -c++ -outdir . -includeall -Iinclude | ||
| 47 | 45 | ||
| 46 | # #### Debug support #### | ||
| 48 | ifeq ($(DEBUG),y) | 47 | ifeq ($(DEBUG),y) |
| 49 | CXXFLAGS += -g -DDEBUG | 48 | DEFS += -g -DDEBUG |
| 50 | else | 49 | else |
| 51 | CXXFLAGS += -O2 -DNDEBUG | 50 | DEFS += -O2 -DNDEBUG |
| 52 | endif | 51 | endif |
| 53 | 52 | ||
| 53 | CXXFLAGS = -Wall -Wextra -Werror $(DISABLED_WARNINGS) -fPIC $(INCLUDES) $(DEFS) | ||
| 54 | LDFLAGS = $(LIBS) | ||
| 55 | SWIGFLAGS = -python -c++ -outdir . -includeall -Iinclude | ||
| 54 | vpath %.cc interface | 56 | vpath %.cc interface |
| 55 | vpath %.cpp src src/edf src/blocking | 57 | vpath %.cpp src src/edf src/blocking |
| 56 | 58 | ||
| @@ -85,13 +87,13 @@ interface/%_wrap.cc: interface/%.i | |||
| 85 | $(SWIG) $(SWIGFLAGS) -o $@ $< | 87 | $(SWIG) $(SWIGFLAGS) -o $@ $< |
| 86 | 88 | ||
| 87 | interface/%_wrap.o: interface/%_wrap.cc | 89 | interface/%_wrap.o: interface/%_wrap.cc |
| 88 | $(CXX) -fPIC $(PYTHON_INC) -c -o $@ $+ $(INCLUDES) | 90 | $(CXX) -fPIC $(PYTHON_INC) -c -o $@ $+ $(INCLUDES) |
| 89 | 91 | ||
| 90 | _sched.so: ${CORE_OBJ} ${EDF_OBJ} interface/sched_wrap.o | 92 | _sched.so: ${CORE_OBJ} ${EDF_OBJ} interface/sched_wrap.o |
| 91 | $(CXX) $(SOFLAGS) $(PYTHON_LIB) -o $@ $+ $(LDFLAGS) | 93 | $(CXX) $(SOFLAGS) $(PYTHON_LIB) -o $@ $+ $(LDFLAGS) |
| 92 | 94 | ||
| 93 | _locking.so: ${SYNC_OBJ} interface/locking_wrap.o | 95 | _locking.so: ${SYNC_OBJ} interface/locking_wrap.o |
| 94 | $(CXX) $(SOFLAGS) $(PYTHON_LIB) -o $@ $+ $(LDFLAGS) | 96 | $(CXX) $(SOFLAGS) $(PYTHON_LIB) -o $@ $+ $(LDFLAGS) |
| 95 | 97 | ||
| 96 | _sim.so: ${CORE_OBJ} ${SCHED_OBJ} interface/sim_wrap.o | 98 | _sim.so: ${CORE_OBJ} ${SCHED_OBJ} interface/sim_wrap.o |
| 97 | $(CXX) $(SOFLAGS) $(PYTHON_LIB) -o $@ $+ $(LDFLAGS) | 99 | $(CXX) $(SOFLAGS) $(PYTHON_LIB) -o $@ $+ $(LDFLAGS) |
