From 8d7d11ad8144edd5a5d0612871db61f6ef860707 Mon Sep 17 00:00:00 2001 From: midipix Date: Sep 21 2016 23:57:11 +0000 Subject: project: always use an external folder as the primary source directory. --- diff --git a/config.project b/config.project index c59ae68..4999272 100644 --- a/config.project +++ b/config.project @@ -1,6 +1,7 @@ # project mb_package=cparser mb_require_out_of_tree=no +mb_require_source_dir=yes mb_custom_install_headers=yes mb_avoid_version=no diff --git a/project/common.mk b/project/common.mk index 40ba528..a2c0c11 100644 --- a/project/common.mk +++ b/project/common.mk @@ -1,9 +1,9 @@ -common_src_dirs = $(PROJECT_DIR)/src/*/ +common_src_dirs = $(SOURCE_DIR)/src/*/ common_src_files = $(addsuffix *.c,$(common_src_dirs)) common_sort_files = $(sort $(wildcard $(common_src_files))) -COMMON_SRCS = $(subst $(PROJECT_DIR)/src/,src/,$(common_sort_files)) +COMMON_SRCS = $(subst $(SOURCE_DIR)/src/,src/,$(common_sort_files)) -app_src_dirs = $(PROJECT_DIR)/src/ +app_src_dirs = $(SOURCE_DIR)/src/ app_src_files = $(addsuffix *.c,$(app_src_dirs)) app_sort_files = $(sort $(wildcard $(app_src_files))) -APP_SRCS = $(subst $(PROJECT_DIR)/src/,src/,$(app_sort_files)) +APP_SRCS = $(subst $(SOURCE_DIR)/src/,src/,$(app_sort_files)) diff --git a/project/extras.mk b/project/extras.mk index e878dc0..6d2792d 100644 --- a/project/extras.mk +++ b/project/extras.mk @@ -1,10 +1,11 @@ -CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser -CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/adt -CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/ast -CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/driver -CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/firm -CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/parser -CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/wrappergen +CFLAGS_PATH += -I$(SOURCE_DIR)/src +CFLAGS_PATH += -I$(SOURCE_DIR)/include/cparser +CFLAGS_PATH += -I$(SOURCE_DIR)/include/cparser/adt +CFLAGS_PATH += -I$(SOURCE_DIR)/include/cparser/ast +CFLAGS_PATH += -I$(SOURCE_DIR)/include/cparser/driver +CFLAGS_PATH += -I$(SOURCE_DIR)/include/cparser/firm +CFLAGS_PATH += -I$(SOURCE_DIR)/include/cparser/parser +CFLAGS_PATH += -I$(SOURCE_DIR)/include/cparser/wrappergen src/driver/actions.o: version.tag src/driver/actions.lo: version.tag @@ -18,20 +19,20 @@ install-headers-custom: mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/parser mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/wrappergen - cp $(PROJECT_DIR)/include/cparser/adt/*.h \ + cp $(SOURCE_DIR)/src/adt/*.h \ $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/adt - cp $(PROJECT_DIR)/include/cparser/ast/*.h \ + cp $(SOURCE_DIR)/src/ast/*.h \ $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/ast - cp $(PROJECT_DIR)/include/cparser/driver/*.h \ + cp $(SOURCE_DIR)/src/driver/*.h \ $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/driver - cp $(PROJECT_DIR)/include/cparser/firm/*.h \ + cp $(SOURCE_DIR)/src/firm/*.h \ $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/firm - cp $(PROJECT_DIR)/include/cparser/parser/*.h \ + cp $(SOURCE_DIR)/src/parser/*.h \ $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/parser - cp $(PROJECT_DIR)/include/cparser/wrappergen/*.h \ + cp $(SOURCE_DIR)/src/wrappergen/*.h \ $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/wrappergen diff --git a/project/headers.mk b/project/headers.mk index 065fb10..892d860 100644 --- a/project/headers.mk +++ b/project/headers.mk @@ -1,11 +1,11 @@ -api_include_dirs = $(PROJECT_DIR)/include/cparser/*/ +api_include_dirs = $(SOURCE_DIR)/include/cparser/*/ api_include_headers = $(addsuffix *.h,$(api_include_dirs)) api_sort_headers = $(sort $(wildcard $(api_include_headers))) API_HEADERS = $(api_sort_headers) -internal_dirs = $(PROJECT_DIR)/src/internal/ +internal_dirs = $(SOURCE_DIR)/src/internal/ internal_files = $(addsuffix *.h,$(internal_dirs)) internal_sort_files = $(sort $(wildcard $(internal_files))) -INTERNAL_HEADERS = $(subst $(PROJECT_DIR)/src/,src/,$(internal_sort_files)) +INTERNAL_HEADERS = $(subst $(SOURCE_DIR)/src/,src/,$(internal_sort_files)) ALL_HEADERS = $(API_HEADERS) $(INTERNAL_HEADERS)