-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile.mingw
44 lines (36 loc) · 935 Bytes
/
Makefile.mingw
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
#
# Tiny BASIC Interpreter and Compiler Project
# Makefile for MinGW Cross-compiler (Linux->Windows)
#
# Released as Public Domain by Damian Gareth Walker 2019
# Created: 21-Sep-2019
#
# Target
TARGET = tinybasic.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 := x86_64-w64-mingw32-gcc
CFLAGS := -Wall
INC := -I$(INCDIR) -I/usr/local/include
# 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) -o $(TARGETDIR)/$(TARGET) $(OBJECTS)
$(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT)
$(CC) $(CFLAGS) $(INC) -c -o $@ $<
# Cleanup
clean:
rm -f $(BUILDDIR)/*.$(OBJEXT)
rm -f $(TARGETDIR)/$(TARGET)