-
Notifications
You must be signed in to change notification settings - Fork 984
/
Copy pathfat_lib.mk
55 lines (44 loc) · 1.78 KB
/
fat_lib.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Defines rules for building a fat library for distribution.
#
# The including makefile must define the variables:
# FAT_LIB_NAME
# FAT_LIB_SOURCES_RELATIVE
# FAT_LIB_SOURCE_DIRS
# FAT_LIB_COMPILE
# The including makefile may define the following optional variables:
# FAT_LIB_PRECOMPILED_HEADER
# FAT_LIB_OSX_FLAGS
#
# This file defines the following to be used by the including file:
# FAT_LIB_LIBRARY
#
# The including file may specify dependencies to compilation by adding
# prerequisites to the "fat_lib_dependencies" target.
#
# Author: Keith Stanger
include $(J2OBJC_ROOT)/make/fat_lib_macros.mk
FAT_LIB_LIBRARY = $(ARCH_BUILD_DIR)/lib$(FAT_LIB_NAME).a
FAT_LIB_PLISTS = \
$(foreach src,$(FAT_LIB_SOURCES_RELATIVE),$(FAT_LIB_PLIST_DIR)/$(basename $(src)).plist)
FAT_LIB_OBJS = $(foreach file,$(FAT_LIB_SOURCES_RELATIVE),$(basename $(file)).o)
ifndef IS_CLEAN_GOAL
$(call emit_compile_rules,$(FAT_LIB_SOURCE_DIRS),$(FAT_LIB_COMPILE),$(FAT_LIB_PRECOMPILED_HEADER))
FAT_LIBS := $(call emit_library_rules,$(FAT_LIB_NAME),$(FAT_LIB_OBJS))
FAT_LIBS_DIST = $(FAT_LIBS:$(ARCH_BUILD_DIR)/%=$(ARCH_LIB_DIR)/%)
$(ARCH_LIB_DIR)/%.a: $(ARCH_BUILD_DIR)/%.a
@mkdir -p $(@D)
@install -m 0644 $< $@
analyze: $(FAT_LIB_PLISTS)
@:
endif # ifndef IS_CLEAN_GOAL