-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (61 loc) · 2.18 KB
/
Copy pathMakefile
File metadata and controls
77 lines (61 loc) · 2.18 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
# ============================================================
# Makefile for s3ctl - S3 ViRGE Runtime Control Utility
# Open Watcom 1.9 / 2.0
#
# Targets:
# wmake Build s3ctl.exe (default)
# wmake clean Remove build artifacts
# wmake rebuild Clean then build
# ============================================================
# ---- Tools --------------------------------------------------
CC = wcc
LINKER = wlink
# ---- Output -------------------------------------------------
TARGET = s3ctl.exe
OBJ = s3ctl.obj
# ---- Compiler flags -----------------------------------------
#
# -bt=dos Target: 16-bit real mode DOS
# -ms Memory model: small
# -os Optimize for size
# -s Disable stack overflow checks
# -wx Maximum warnings
# -zq Quiet mode
CFLAGS = -bt=dos -ms -os -s -wx -zq
# ============================================================
# Default target
# ============================================================
all: $(TARGET)
# Step 1: Compile to object file
$(OBJ): s3ctl.c
$(CC) $(CFLAGS) s3ctl.c
# Step 2: Link with explicit DOS system target
# 'system dos' is the critical directive that produces a proper
# DOS MZ executable rather than a Windows NE executable.
$(TARGET): $(OBJ)
$(LINKER) system dos name $(TARGET) file $(OBJ) library clibs.lib
@echo.
@echo Build complete: $(TARGET)
@echo.
# ============================================================
# Clean
# ============================================================
clean:
@if exist *.obj del *.obj
@if exist *.err del *.err
@if exist $(TARGET) del $(TARGET)
@echo Cleaned.
# ============================================================
# Rebuild
# ============================================================
rebuild: clean all
# ============================================================
# Help
# ============================================================
help:
@echo.
@echo wmake Build $(TARGET)
@echo wmake clean Remove build artifacts
@echo wmake rebuild Clean then build
@echo wmake help Show this message
@echo.