-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
89 lines (84 loc) · 3.57 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
#/*-----------------------------------------------------------------------------+
#File Name: Makefile
#+------------------------------------------------------------------------------+
#
#+------------------------------------------------------------------------------+
# Programming III COP4338
# Author: Daniel Gonzalez P#4926400
# assignment 5: Date Validate / Format
# Date: 11/08/2016 ELLECTION DAY!!!!
#
# program description
# Input: Accept input for the first program via the command-line arguments.
# Input will be the number of valid entries to be redirected from
# the dates input file (dates.dat). A zero indicates to input all
# entries from the dates input file. Your program should validate
# (day, month & year - see page 111 for validation ideas) and skip
# corrupt dates in the dates.dat file (see page 159 for scanning
# ideas). This validated input will then be piped out to the
# second program.
# The second program will accept these validated dates in the
# month/day/year format and convert each of them to the day,
# abbreviated month & year format — both exhibited above. The
# abbreviated month should consist of the first three letters of
# the month, capitalized. These converted results will be redirected
# to the output file (output.dat), followed by a copy of the
# original (dates.dat) data.
#
# Output: Generates an output file (output.dat) that contains a
# converted list of dates in day, abbreviated month & year
# format (i.e. 1 JAN 1900), followed by the original list of
# dates in month/day/year format (i.e. 1/1/1900). This output file
# will be the result of appending the input file (dates.dat), which
# is accessed by the first program, with the result output file
# (output.dat), generated by the second program.
#
#
# +-------------------------------------------------------------------------+
# | I Daniel Gonzalez #4926400 hereby certify that this collective work is |
# | my own and none of it is the work of any other person or entity. |
# +-------------------------------------------------------------------------+
#
#
# how to compile and execute:
# 1.Open the terminal
# Go to the program folder that contains all the files required for
# the program to compile including all header files(*.h).
# Run the following command "make"
#
# 2.Open the terminal
# Go to the program folder that contains all the files required for
# the program to compile including all header files(*.h).
# COMPILE: "gcc -Wall -w -lm readDate.c dateValidate.c -o validateDate"
#
# Program execution:
# From the terminal enter:
# “./validateDate < dates.dat [X] | ./format > output.dat"
#
# X: is the amount of validated dates
#
#
#
#
#+-----------------------------------------------------------------------------*/
COMPILER = gcc
FLAGS = -Wall -w
LIBS = -lm
READ_OBJECT = readDate.o
FORMAT_OBJECT = format.o
GENERAL_OBJECT = functions.o
HEADER = general.h
OBJS = functions.o readDate.o format.o
all: $(GENERAL_OBJECT) read format clean
# Link file and format file.
read: $(READ_OBJECT)
$(COMPILER) $(FLAGS) $(READ_OBJECT) $(GENERAL_OBJECT) \
-o validateDate $(LIBS)
format: $(FORMAT_OBJECT)
$(COMPILER) $(FLAGS) $(FORMAT_OBJECT) $(GENERAL_OBJECT) \
-o format $(LIBS)
#Compile each individual objects with headers
$(OBJS) : $(HEADER)
.PHONY: clean
clean:
rm *.o