-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlpng1232.mk
More file actions
74 lines (62 loc) · 1.83 KB
/
lpng1232.mk
File metadata and controls
74 lines (62 loc) · 1.83 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# Makefile for libpng.a
#
#
# Copyright (C) 2019, kdaic
# All right reserved.
# This software is made under the MIT License.
# http://opensource.org/licenses/mit-license.php
#
##################################################################################
OS:=$(shell uname -s)
UNAME := $(shell uname)
##################################################################################
# compiler
# OS dependency
ifeq ($(OS),Linux)
CXX:=gcc
else ifeq ($(OS),QNX)
CXX:=qcc
else
$(error unknown OS $(OS))
endif
##################################################################################
# local directory
LIB_DIR = ./lib
SRC_DIR = ./src/hrpUtil/lpng1232
INCLUDE_DIR = ./include/hrpUtil/lpng1232 ./include/hrpUtil/zlib
CFLAGS = -O2 $(addprefix -I, $(INCLUDE_DIR))
SOURCES = png.c pngerror.c pngget.c pngmem.c pngpread.c pngread.c \
pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c pngwio.c \
pngwrite.c pngwtran.c pngwutil.c
##################################################################################
#
LIB_SRC = $(addprefix $(SRC_DIR)/, $(SOURCES))
LIB_OBJS=$(LIB_SRC:%.c=%.o)
SLIB_APP = $(LIB_DIR)/libpng.a
##################################################################################
# Target
all: compile_title $(SLIB_APP)
compile_title:
@echo
@echo "COMPILE_TARGETS="$(SLIB_APP)"\n"
@echo ---- $(MAKE) $(SLIB_APP) "("$(shell basename $(shell pwd))")" ----- "\n"
# separate compile -- make staic library
$(SLIB_APP): $(LIB_OBJS)
@echo "\n "$^" --> "$@"\n"
@if [ ! -d $(LIB_DIR) ]; then \
mkdir -p $(LIB_DIR); \
fi
ar rcs $@ $^
# @rm $(LIB_OBJS)
### common compile -- make object file
%.o: %.c
@echo "\n "$<" --> "$@"\n"
@echo "$(CXX) -c $(CFLAGS) $(INCLUDES_PATH) -o $@ $<";
$(CXX) -c $(CFLAGS) -o $@ $<;
# make clean
clean:
rm -f $(SRC_DIR)/*.o
# make cleanall
cleanall: clean
rm -f $(SLIB_APP)