summaryrefslogtreecommitdiffhomepage
path: root/project
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-10 23:45:13 -0400
committermidipix <writeonce@midipix.org>2016-05-10 23:45:13 -0400
commit9c558eed45d42d3660abed5f416328269294d078 (patch)
treed7171fb255e136165165b1b84450064e041f37c4 /project
parent39423d0fa25237c2533f7f604edc209831382090 (diff)
downloadpemagine-9c558eed45d42d3660abed5f416328269294d078.tar.bz2
pemagine-9c558eed45d42d3660abed5f416328269294d078.tar.xz
build system: upgrade build system, eliminate differences in core definitions.
Prior to this patch, there were several differences between this project's build system and the one from which it was derived (sofort). Although the differences were very minor and for the most part related to this project being part of a free-standing, midipix-specific development framework, they still added an extra maintenance burden, specifically by requiring that common changes be applied via patch(1) rather than git-am(1). Following recent improvements to the common build system, it is now possible to have a free-standing, midipix-specific project without any changes to the core build system files, hence the current upgrade.
Diffstat (limited to 'project')
-rw-r--r--project/defs.mk31
-rw-r--r--project/extras.mk21
-rw-r--r--project/headers.mk18
-rw-r--r--project/overrides.mk7
-rw-r--r--project/tagver.mk5
5 files changed, 32 insertions, 50 deletions
diff --git a/project/defs.mk b/project/defs.mk
deleted file mode 100644
index b91ed07..0000000
--- a/project/defs.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-SHARED_LIB_DEPS =
-SHARED_APP_DEPS =
-STATIC_APP_DEPS =
-
-COMMON_LOBJS = $(COMMON_SRCS:.c=.lo)
-COMMON_OBJS = $(COMMON_SRCS:.c=.o)
-
-ARCH_LOBJS = $(ARCH_SRCS:.c=.lo)
-ARCH_OBJS = $(ARCH_SRCS:.c=.o)
-
-SHARED_OBJS = $(COMMON_LOBJS) $(ARCH_LOBJS)
-STATIC_OBJS = $(COMMON_OBJS) $(ARCH_OBJS)
-
-SHARED_LIB = lib/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_LIB_SUFFIX)
-STATIC_LIB = lib/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_ARCHIVE_EXT)
-SHARED_IMPLIB = lib/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_IMPLIB_EXT)
-
-CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_CONFIG) $(CFLAGS_SYSROOT) \
- $(CFLAGS_COMMON) $(CFLAGS_CMDLINE) $(CFLAGS_HOST) \
- $(CFLAGS_PATH)
-
-CFLAGS_SHARED = $(CFLAGS) $(CFLAGS_PIC) $(CFLAGS_SHARED_ATTR)
-CFLAGS_STATIC = $(CFLAGS) $(CFLAGS_OBJ) $(CFLAGS_STATIC_ATTR)
-
-LDFLAGS_SHARED = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
- $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
- $(LDFLAGS_PATH) $(SHARED_LIB_DEPS) $(LDFLAGS_LAST)
-
-LDFLAGS_STATIC = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
- $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
- $(LDFLAGS_PATH) $(STATIC_APP_DEPS) $(LDFLAGS_LAST)
diff --git a/project/extras.mk b/project/extras.mk
index fe95d37..d95c532 100644
--- a/project/extras.mk
+++ b/project/extras.mk
@@ -1,15 +1,26 @@
CFLAGS_SHARED_ATTR += -DPE_BUILD
CFLAGS_STATIC_ATTR += -DPE_STATIC
-CFLAGS_CONFIG += -DMIDIPIX_FREESTANDING -ffreestanding -D__NT$(HOST_BITS)
+CFLAGS_CONFIG += -DMIDIPIX_FREESTANDING -D__NT$(HOST_BITS)
CFLAGS_CONFIG += -UWIN32 -U_WIN32 -U__WIN32 -U__WIN32__
CFLAGS_CONFIG += -UWIN64 -U_WIN64 -U__WIN64 -U__WIN64__
-LDFLAGS_SHARED += --out-implib $(SHARED_IMPLIB)
-LDFLAGS_SHARED += --exclude-all-symbols
+LDFLAGS_SHARED += -Wl,--exclude-all-symbols
+LDFLAGS_SHARED += -nostdlib
ifeq ($(HOST_BITS),32)
- LDFLAGS_SHARED += --entry $(HOST_UNDERSCORE)pe_entry_point@12
+ LDFLAGS_SHARED += -Wl,--entry -Wl,$(HOST_UNDERSCORE)pe_entry_point@12
else
- LDFLAGS_SHARED += --entry $(HOST_UNDERSCORE)pe_entry_point
+ LDFLAGS_SHARED += -Wl,--entry -Wl,$(HOST_UNDERSCORE)pe_entry_point
endif
+
+install-headers-custom: install-headers-default
+ mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/bits
+ mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/bits/nt32
+ mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/bits/nt64
+
+ cp $(API_HEADERS_NT32) \
+ $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/bits/nt32
+
+ cp $(API_HEADERS_NT64) \
+ $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/bits/nt64
diff --git a/project/headers.mk b/project/headers.mk
index d89e2fd..3ffb290 100644
--- a/project/headers.mk
+++ b/project/headers.mk
@@ -1,17 +1,17 @@
API_HEADERS = \
- $(PROJECT_DIR)/include/pemagine/pemagine.h \
- $(PROJECT_DIR)/include/pemagine/pe_api.h \
- $(PROJECT_DIR)/include/pemagine/pe_consts.h \
- $(PROJECT_DIR)/include/pemagine/pe_inline_asm.h \
- $(PROJECT_DIR)/include/pemagine/pe_structs.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/pemagine.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/pe_api.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/pe_consts.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/pe_inline_asm.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/pe_structs.h \
API_HEADERS_NT32 = \
- $(PROJECT_DIR)/include/pemagine/bits/nt32/pe_inline_asm__gcc.h \
- $(PROJECT_DIR)/include/pemagine/bits/nt32/pe_inline_asm__msvc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/bits/nt32/pe_inline_asm__gcc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/bits/nt32/pe_inline_asm__msvc.h \
API_HEADERS_NT64 = \
- $(PROJECT_DIR)/include/pemagine/bits/nt64/pe_inline_asm__gcc.h \
- $(PROJECT_DIR)/include/pemagine/bits/nt64/pe_inline_asm__msvc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/bits/nt64/pe_inline_asm__gcc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/bits/nt64/pe_inline_asm__msvc.h \
INTERNAL_HEADERS = \
$(PROJECT_DIR)/src/internal/pe_impl.h
diff --git a/project/overrides.mk b/project/overrides.mk
index 2a67ff9..65ebf21 100644
--- a/project/overrides.mk
+++ b/project/overrides.mk
@@ -1,6 +1,3 @@
-# direct linker invocation
-LDFLAGS_SYSROOT = $(CFLAGS_SYSROOT)
-
-ifneq ($(PE_SUBSYSTEM)x,x)
- LDFLAGS_COMMON += --subsystem=$(PE_SUBSYSTEM)
+ifneq ($(PE_SUBSYSTEM),)
+ LDFLAGS_COMMON += -Wl,--subsystem=$(PE_SUBSYSTEM)
endif
diff --git a/project/tagver.mk b/project/tagver.mk
new file mode 100644
index 0000000..53b8b51
--- /dev/null
+++ b/project/tagver.mk
@@ -0,0 +1,5 @@
+VER_NAMESPACE = PE
+
+VER_MAJOR = 0
+VER_MINOR = 0
+VER_PATCH = 0