cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

Makefile (796B)


      1# Simple Makefile for the lcc frontend.
      2
      3ifndef TARGETDIR
      4TARGETDIR = /opt/gbdk
      5endif
      6
      7# MacOS date doesn't support '--utc', use '-u'
      8BUILDDATE=$(shell date -u +%Y/%m/%d)
      9BUILDTIME=$(shell date -u +%H:%M:%S)
     10
     11ifeq ($(OS),Windows_NT)
     12	BUILD_OS := Windows_NT
     13else
     14	BUILD_OS := $(shell uname -s)
     15endif
     16
     17# Target older macOS version than whatever build OS is for better compatibility
     18ifeq ($(BUILD_OS),Darwin)
     19	export MACOSX_DEPLOYMENT_TARGET=10.10
     20endif
     21
     22
     23CC = $(TOOLSPREFIX)gcc
     24CFLAGS = -ggdb -O -Wno-incompatible-pointer-types -DGBDKLIBDIR=\"$(TARGETDIR)\"
     25CFLAGS += -DBUILDDATE=\"$(BUILDDATE)\" -DBUILDTIME=\"$(BUILDTIME)\"
     26ifdef BINDIR
     27CFLAGS += -DGBDKBINDIR=\"$(BINDIR)\"
     28endif
     29OBJ = lcc.o gb.o targets.o list.o
     30BIN = lcc
     31
     32all: $(BIN)
     33
     34$(BIN): $(OBJ)
     35
     36clean:
     37	rm -f *.o $(BIN) *~
     38	rm -f *.exe
     39