-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
177 lines (147 loc) · 4.76 KB
/
Makefile
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
## GNU Linux make (GCC)
## MS Windows nmake (CL)
CC=gcc
CFLAGS = -Wall `pkg-config --cflags --libs gtk+-3.0` -export-dynamic
all: notes ttyRosary gtkRosary ttyBashrc manpage
## Notes
notes:
##
## Makefile note:
##
## Install dependencies:
## sudo make debian
## sudo make archlinux
##
## ###################################################################
## Use the "-v" flag to use the optional Latin translation feature
## ex: ./ttyRosary -v
## ex: ./gtkRosary -v
## ###################################################################
##
################
## Main Binaries
################
## english and latin
ttyRosary: my_calendar.o my_csv_structs.o my_json_structs.o my_tty_ui.o my_tty_ui_posix.o mainTTY.o manpage
$(CC) my_calendar.o my_csv_structs.o my_json_structs.o my_tty_ui.o my_tty_ui_posix.o mainTTY.o -ljson-c -o "ttyRosary"
## GTK UI english and latin
gtkRosary: mainGtk3.o my_calendar.o my_csv_structs.o my_json_structs.o my_gtk3_api.o manpage
$(CC) mainGtk3.o my_calendar.o my_csv_structs.o my_json_structs.o my_gtk3_api.o $(CFLAGS) -ljson-c -o "gtkRosary"
## holiday season bash environment splash
ttyBashrc: my_calendar.o my_csv_structs.o my_tty_ui.o my_tty_ui_posix.o mainBashrc.o
$(CC) my_calendar.o my_csv_structs.o my_tty_ui.o my_tty_ui_posix.o mainBashrc.o -o "ttyBashrc"
bash sources/make-holiday-bashrc.sh
###########################
## Compile binary libraries
###########################
my_calendar.o: sources/my_calendar.c headers/my_calendar.h
## compile and build "my_calendar.c"
$(CC) -c sources/my_calendar.c
#
my_csv_structs.o: sources/my_csv_structs.c headers/my_file_to_struct.h
## compile and build "my_csv_structs.c"
$(CC) -c sources/my_csv_structs.c
#
my_json_structs.o: sources/my_json_structs.c headers/my_file_to_struct.h
## compile and build "my_json_structs.c"
$(CC) -c sources/my_json_structs.c
#
my_tty_ui.o: sources/my_tty_ui.c headers/my_tty_ui.h my_calendar.o my_csv_structs.o
## compile and "build my_tty_ui.c"
$(CC) -c sources/my_tty_ui.c
#
my_tty_ui_posix.o: sources/my_tty_ui_posix.c headers/my_tty_ui.h my_calendar.o my_csv_structs.o
## compile and "build my_tty_ui_posix.c"
$(CC) -c sources/my_tty_ui_posix.c
#
my_gtk3_api.o: sources/my_gtk3_api.c headers/my_gtk3_api.h my_calendar.o my_csv_structs.o my_json_structs.o
## compile and build "my_gtk3_api.c"
$(CC) -c sources/my_gtk3_api.c $(CFLAGS)
#
mainTTY.o: mainTTY.c my_calendar.o my_csv_structs.o my_json_structs.o my_tty_ui.o my_tty_ui_posix.o
## compile and build "mainTTY.c"
$(CC) -c mainTTY.c
#
mainGtk3.o: mainGtk3.c my_calendar.o my_csv_structs.o my_json_structs.o my_gtk3_api.o
## compile and build "mainGtk3.c"
$(CC) -c mainGtk3.c $(CFLAGS)
#
mainBashrc.o: mainBashrc.c my_calendar.o my_csv_structs.o my_tty_ui.o my_tty_ui_posix.o
## compile and build "mainBashrc.c"
$(CC) -c mainBashrc.c
#
#####################
## GNU/Linux dependencies
#####################
debian:
## Dependencies for Debian 9 (Stretch) or later
## gcc
sudo apt install -y build-essential gcc
## gtk
sudo apt install -y libgtk-3-dev
## json-c
sudo apt install -y libjson-c-dev libjson-c-doc libjson-c3
## man page
sudo apt install -y man-db groff pandoc
## glade ide
# sudo apt install -y glade
#
archlinux:
## Dependencies for Archlinux
sudo pacman -Sy --needed base base-devel gcc gtk3
# sudo pacman -Sy glade
#
tclinux:
## Dependencies for Tiny Core Linux (busybox)
tce-load -wil compiletc.tcz
tce-load -wil json-c-dev.tcz
tce-load -wil gtk3-dev.tcz
# tce-load -wil glade-dev.tcz
#
alpine:
## Dependencies for Alpine Linux (busybox, chrony)
sudo apk add build-base
sudo apk add json-c-dev
sudo apk add gtk+3.0-dev
#
manpage: man/manpage.md
## generate a manpage file with Pandoc from an Rmarkdown file
## global man page
# pandoc man/manpage.md -s -t man > /usr/bin/printf-time
## local man page
pandoc ./man/manpage.md -s -t man > man/printf-time
help: man/printf-time
man ./man/printf-time
clean:
## removing any precompiled binaries (Linux)
rm -f *.o ttyRosary gtkRosary ttyBashrc *.o *.out *.obj *.exe
bash sources/clean-holiday-bashrc.sh
#
cleanBashrc:
## remove backup ~/.bashrc
rm ~/.bashrc.backup*
#####################
## Windows 10 nmake
#####################
nclean:
:::: clean previous *.obj and *.exe builds (Win10)
@IF EXIST *.obj DEL /F *.obj;
@IF EXIST *.exe DEL /F *.exe;
::
:::: clean vscode related files
@IF EXIST *.obj DEL /F *.ilk;
@IF EXIST *.exe DEL /F *.pdb;
::
:::: batch script tp perform clean
::Makefile_win.bat clean
build:
:::: compile ttyRosary
cl /c sources\my_calendar.c
cl /c sources\my_csv_structs.c
cl /c sources\my_tty_ui.c
::
:::: build executable ttyRosary.exe
cl mainTTY.c my_calendar.obj my_csv_structs.obj my_tty_ui.obj /Fe"ttyRosary.exe"
::
:::: batch script to perform build
::Makefile_win.bat build