-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·107 lines (81 loc) · 2.19 KB
/
Makefile
File metadata and controls
executable file
·107 lines (81 loc) · 2.19 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# Makefile generated by:
# codebench 0.55
#
# Project: Earmark
#
# Created on: 13-01-2021 16:59:22
#
#
###################################################################
##
##//// Objects
##
###################################################################
BUILD = debug
NAME = earmark
VPATH = src md4c/src
SRCS = \
amimd.c \
byte_buffer.c \
editor_gadget.c \
gui.c \
hyperlink_editor.c \
image_editor.c \
info_gadget.c \
json_util.c \
md_to_html.c \
prefs.c \
search_gadget.c \
settings_gadget.c \
string_utils.c \
table_editor.c \
viewer_gadget.c \
entity.c \
md4c.c \
md4c-html.c \
DIR_OBJS = build/$(BUILD)
OBJS = $(patsubst %.c, $(DIR_OBJS)/%.o, $(SRCS))
#LIBS = /SDK/local/newlib/lib/libcurl.a
###################################################################
##
##//// Variables and Environment
##
###################################################################
CC := gcc:bin/gcc
MAKEDEPEND := gcc -MM -MF
INCPATH := -I SDK:MUI/C/Include -Iinclude -Imd4c/src -ISDK:include/include_h/jansson -I SDK:local/common/include
CFLAGS := $(INCPATH) -Werror -Wwrite-strings -Wextra -Wshadow -DAMIGA=1
ifeq ($(BUILD),release)
CFLAGS += -O3
APP = $(NAME)
else
CFLAGS += -gstabs -D_DBUG=1
APP = $(NAME).debug
endif
ifneq ($(MAKECMDGOALS), clean)
-include $(OBJS:.o=.d)
endif
.PHONY: clean init package all
all: $(DIR_OBJS)/$(APP)
$(DIR_OBJS)/$(APP): init $(OBJS) $(LIBS)
$(CC) -o $(DIR_OBJS)/$(APP) $(OBJS) $(LIBS) $(LDFLAGS)
copy $(DIR_OBJS)/$(APP) $(APP)
clean:
rm -fr $(DIR_OBJS)/
init:
mkdir -p $(DIR_OBJS)
# Compile and generate dependency info
# 1. Compile the .c file
# 2. Generate dependency information, explicitly specifying the target name
$(DIR_OBJS)/%.o : %.c
@echo ">>> c build for $@"
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
@$(MAKEDEPEND) $(basename $@).d -MT $(basename $@).o $(CPPFLAGS) $(CFLAGS) $<
@mv -f $(basename $@).d $(basename $@).d.tmp
@sed -e "s|.*:|$*.o:|" < $(basename $@).d.tmp > $(basename $@).d
@mv -f $(basename $@).d $(basename $@).d.tmp
@sed -e "s/.*://" -e "s/\\$$//" < $(basename $@).d.tmp | fmt -1 | \
sed -e "s/^ *//" -e "s/$$/:/" >> $(basename $@).d
@mv -f $(basename $@).d $(basename $@).d.tmp
@rm -f $(basename $@).d.tmp