summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-09-20 23:25:19 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:20 -0500
commitd40d138ed41ff78fc0347ce256f88d09f405ba37 (patch)
treef14c9e7d4974152aafa409ebdabc868852d793a0 /project
parentc145a8039d5d10ceb10714b94d376cf109308d47 (diff)
downloadperk-d40d138ed41ff78fc0347ce256f88d09f405ba37.tar.bz2
perk-d40d138ed41ff78fc0347ce256f88d09f405ba37.tar.xz
makefile replacement: step 2/2: use the midipix build template.
Diffstat (limited to 'project')
-rw-r--r--project/arch.mk0
-rw-r--r--project/common.mk13
-rw-r--r--project/defs.mk44
-rw-r--r--project/depends.mk0
-rw-r--r--project/extras.mk3
-rw-r--r--project/headers.mk12
-rw-r--r--project/overrides.mk0
-rw-r--r--project/tree.mk7
8 files changed, 79 insertions, 0 deletions
diff --git a/project/arch.mk b/project/arch.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/arch.mk
diff --git a/project/common.mk b/project/common.mk
new file mode 100644
index 0000000..da67e9a
--- /dev/null
+++ b/project/common.mk
@@ -0,0 +1,13 @@
+COMMON_SRCS = \
+ src/main/pe_get_image_meta.c \
+ src/main/pe_map_raw_image.c \
+ src/reader/pe_read_import_header.c \
+ src/reader/pe_read_export_header.c \
+ src/reader/pe_read_dos_header.c \
+ src/reader/pe_read_coff_header.c \
+ src/reader/pe_read_section_header.c \
+ src/reader/pe_read_optional_header.c \
+ src/output/pe_output_export_symbols.c
+
+APP_SRCS = \
+ src/main/perk.c
diff --git a/project/defs.mk b/project/defs.mk
new file mode 100644
index 0000000..b3be937
--- /dev/null
+++ b/project/defs.mk
@@ -0,0 +1,44 @@
+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)
+
+APP_LOBJS ?= $(APP_SRCS:.c=.lo)
+APP_OBJS ?= $(APP_SRCS:.c=.o)
+
+SHARED_OBJS ?= $(COMMON_LOBJS) $(ARCH_LOBJS)
+STATIC_OBJS ?= $(COMMON_OBJS) $(ARCH_OBJS)
+
+SHARED_LIB ?= $(LIB_DIR)/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_LIB_SUFFIX)
+STATIC_LIB ?= $(LIB_DIR)/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_ARCHIVE_EXT)
+SHARED_IMPLIB ?= $(LIB_DIR)/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_IMPLIB_EXT)
+
+APP ?= $(BIN_DIR)/$(OS_APP_PREFIX)$(PACKAGE)$(OS_APP_SUFFIX)
+DEFAULT_APP ?= $(BIN_DIR)/$(OS_APP_PREFIX)$(PACKAGE)-default$(OS_APP_SUFFIX)
+SHARED_APP ?= $(BIN_DIR)/$(OS_APP_PREFIX)$(PACKAGE)-shared$(OS_APP_SUFFIX)
+STATIC_APP ?= $(BIN_DIR)/$(OS_APP_PREFIX)$(PACKAGE)-static$(OS_APP_SUFFIX)
+
+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)
+CFLAGS_APP ?= $(CFLAGS) $(CFLAGS_OBJ) $(CFLAGS_APP_ATTR)
+
+LDFLAGS_SHARED ?= $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
+ $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
+ $(LDFLAGS_PATH) $(SHARED_LIB_DEPS) $(LDFLAGS_LAST)
+
+LDFLAGS_APP ?= $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
+ $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
+ $(LDFLAGS_PATH) $(SHARED_APP_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/depends.mk b/project/depends.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/depends.mk
diff --git a/project/extras.mk b/project/extras.mk
new file mode 100644
index 0000000..15f26fb
--- /dev/null
+++ b/project/extras.mk
@@ -0,0 +1,3 @@
+CFLAGS_SHARED_ATTR += -DPERK_PRE_ALPHA
+CFLAGS_STATIC_ATTR += -DPERK_PRE_ALPHA
+CFLAGS_APP_ATTR += -DPERK_APP
diff --git a/project/headers.mk b/project/headers.mk
new file mode 100644
index 0000000..9762424
--- /dev/null
+++ b/project/headers.mk
@@ -0,0 +1,12 @@
+API_HEADERS = \
+ $(PROJECT_DIR)/include/$(PACKAGE)/perk.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/perk_api.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/perk_consts.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/perk_meta.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/perk_output.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/perk_structs.h
+
+INTERNAL_HEADERS = \
+ $(PROJECT_DIR)/src/internal/$(PACKAGE)_impl.h
+
+ALL_HEADERS = $(API_HEADERS) $(INTERNAL_HEADERS)
diff --git a/project/overrides.mk b/project/overrides.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/overrides.mk
diff --git a/project/tree.mk b/project/tree.mk
new file mode 100644
index 0000000..0c5a1cc
--- /dev/null
+++ b/project/tree.mk
@@ -0,0 +1,7 @@
+tree.tag:
+ mkdir -p src
+ mkdir -p src/internal
+ mkdir -p src/main
+ mkdir -p src/output
+ mkdir -p src/reader
+ touch tree.tag