diff --git a/Makefile b/Makefile index b49174165..c5ee7750c 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,7 @@ include Makefile.inc -CFLAGS += -I./include -fno-strict-aliasing - -LIBS += -lrt -lpthread -lprotobuf-c - -DEFINES += -D_FILE_OFFSET_BITS=64 -DEFINES += -D_GNU_SOURCE - -ifneq ($(WERROR),0) - WARNINGS += -Werror -endif - -ifeq ($(DEBUG),1) - DEFINES += -DCR_DEBUG -endif - -ifeq ($(DEBUG),1) - DEFINES += -DCR_DEBUG - CFLAGS += -O0 -ggdb3 -else - CFLAGS += -O2 -endif - -WARNINGS += -Wall -CFLAGS += $(WARNINGS) $(DEFINES) - PROGRAM := crtools -export CC ECHO MAKE CFLAGS LIBS ARCH DEFINES - OBJS += parasite-syscall.o OBJS += cr-restore.o OBJS += crtools.o diff --git a/Makefile.inc b/Makefile.inc index ffa02d9b3..722cbfc7a 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1,3 +1,7 @@ +# +# Common definitions +# + ifeq ($(strip $(V)),) E = @echo Q = @ @@ -38,3 +42,30 @@ ifeq ($(uname_M),x86_64) endif no-deps-targets := tags cscope clean cleanout cleandep realclean + +CFLAGS += -I./include -fno-strict-aliasing + +LIBS += -lrt -lpthread -lprotobuf-c + +DEFINES += -D_FILE_OFFSET_BITS=64 +DEFINES += -D_GNU_SOURCE + +ifneq ($(WERROR),0) + WARNINGS += -Werror +endif + +ifeq ($(DEBUG),1) + DEFINES += -DCR_DEBUG +endif + +ifeq ($(DEBUG),1) + DEFINES += -DCR_DEBUG + CFLAGS += -O0 -ggdb3 +else + CFLAGS += -O2 +endif + +WARNINGS += -Wall +CFLAGS += $(WARNINGS) $(DEFINES) + +export CC ECHO MAKE CFLAGS LIBS ARCH DEFINES diff --git a/protobuf/Makefile b/protobuf/Makefile index 901fbf848..ff869fb57 100644 --- a/protobuf/Makefile +++ b/protobuf/Makefile @@ -1,21 +1,4 @@ --include ../Makefile.inc - -CFLAGS += -I./include -CFLAGS += -O0 -ggdb3 - -DEFINES += -D_FILE_OFFSET_BITS=64 -DEFINES += -D_GNU_SOURCE - -ifneq ($(WERROR),0) - WARNINGS += -Werror -endif - -ifeq ($(DEBUG),1) - DEFINES += -DCR_DEBUG -endif - -WARNINGS += -Wall -CFLAGS += $(WARNINGS) $(DEFINES) +include ../Makefile.inc LIBRARY := protobuf-lib.o