-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile.watcom
46 lines (38 loc) · 961 Bytes
/
Makefile.watcom
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
#
# Tiny BASIC Interpreter and Compiler Project
# Makefile for Watcom Cross-compiler (Linux->DOS)
# This uses GNU 'make', not Watcom 'wmake'
#
# Released as Public Domain by Damian Gareth Walker 2019
# Created: 21-Sep-2019
#
# Target
TARGET = tinybas.exe
# Paths and extensions
SRCDIR := src
INCDIR := inc
DOCDIR := doc
BUILDDIR := obj
TARGETDIR := bin
INSTALLDIR := /usr/local
SRCEXT := c
HDREXT := h
OBJEXT := o
# Compiler flags
CC := wcl
CFLAGS := -0
INC := -i=$(INCDIR) -i=$(WATCOM)/h
# Generate file lists
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))
# Default make
all: $(TARGETDIR)/$(TARGET)
$(TARGETDIR)/$(TARGET): $(OBJECTS)
$(CC) -fe=$(TARGETDIR)/$(TARGET) $(OBJECTS)
$(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT)
$(CC) $(CFLAGS) $(INC) -c -fo=$@ $<
# Cleanup
clean:
rm -f $(BUILDDIR)/*.$(OBJEXT)
rm -f $(TARGETDIR)/$(TARGET)
rm -f *.err