-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (34 loc) · 1.09 KB
/
Makefile
File metadata and controls
48 lines (34 loc) · 1.09 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
# Makefile for COBOL Web Server
# Uses GnuCOBOL compiler
CC = cobc
CFLAGS = -free -x
CFLAGS_OBJ = -free -c
# Copybook directory
COPYPATH = -I.
# Target executable
TARGET = webserver
# Module object files
MODULES = path-utils.o mime-types.o file-ops.o http-handler.o url-decode.o
# Default target
all: $(TARGET)
# Compile modules to object files
path-utils.o: path-utils.cbl
$(CC) $(CFLAGS_OBJ) $(COPYPATH) path-utils.cbl
mime-types.o: mime-types.cbl
$(CC) $(CFLAGS_OBJ) $(COPYPATH) mime-types.cbl
file-ops.o: file-ops.cbl
$(CC) $(CFLAGS_OBJ) $(COPYPATH) file-ops.cbl
http-handler.o: http-handler.cbl http-structs.cpy file-structs.cpy
$(CC) $(CFLAGS_OBJ) $(COPYPATH) http-handler.cbl
url-decode.o: url-decode.cbl
$(CC) $(CFLAGS_OBJ) $(COPYPATH) url-decode.cbl
# Compile main program and link with modules
$(TARGET): webserver.cbl $(MODULES) config.cpy socket-defs.cpy http-structs.cpy
$(CC) $(CFLAGS) $(COPYPATH) webserver.cbl $(MODULES) -o $(TARGET)
# Clean build artifacts
clean:
rm -f $(TARGET) *.so *.dylib *.o *.c *.c.l.h *.c.h
# Run the server
run: $(TARGET)
./$(TARGET)
.PHONY: all clean run