Skip to content
Snippets Groups Projects
Commit ede3a4c2 authored by rswindell's avatar rswindell
Browse files

Initial support for Borland C++ for Linux (Kylix 3)

parent a35ededf
No related branches found
No related tags found
No related merge requests found
...@@ -2,27 +2,38 @@ ...@@ -2,27 +2,38 @@
######################################################################### #########################################################################
# Makefile for cross-platform development "wrappers" test # # Makefile for cross-platform development "wrappers" test #
# For use with GNU make and GNU C Compiler # # For use with GNU make and GNU C Compiler or Borland C++ (Kylix 3)
#
# @format.tab-size 4, @format.use-tabs true # # @format.tab-size 4, @format.use-tabs true #
# # # #
# usage: gmake [os=target_os] # # usage: gmake [os=target_os] [bcc=1]
#
######################################################################### #########################################################################
# $Id$ # $Id$
# Macros # Macros
DEBUG = 1 # Comment out for release (non-debug) version DEBUG = 1 # Comment out for release (non-debug) version
CC = gcc ifdef bcc
CC = bc++
CFLAGS = -w -D__unix__
else
CC = gcc
CFLAGS = -Wall -O
endif
SLASH = / SLASH = /
OFILE = o OFILE = o
CFLAGS = -Wall
ifndef $(os) ifndef $(os)
os = $(shell uname) os = $(shell uname)
$(warning OS not specified on command line, setting to '$(os)'.) $(warning OS not specified on command line, setting to '$(os)'.)
endif endif
ifdef bcc
ODIR := bcc.$(os)
else
ODIR := gcc.$(os) ODIR := gcc.$(os)
endif
DELETE = rm -fv DELETE = rm -fv
...@@ -30,11 +41,20 @@ ifeq ($(os),FreeBSD) # FreeBSD ...@@ -30,11 +41,20 @@ ifeq ($(os),FreeBSD) # FreeBSD
CFLAGS += -D_THREAD_SAFE CFLAGS += -D_THREAD_SAFE
LFLAGS := -pthread LFLAGS := -pthread
else # Linux / Other UNIX else # Linux / Other UNIX
ifdef bcc
LFLAGS := libpthread.a
else
LFLAGS := -lpthread LFLAGS := -lpthread
endif endif
endif
ifdef DEBUG ifdef DEBUG
CFLAGS += -g -O0 -D_DEBUG ifdef bcc
CFLAGS += -v -y
else
CFLAGS += -g
endif
CFLAGS += -D_DEBUG
ODIR := $(ODIR).debug ODIR := $(ODIR).debug
else # RELEASE else # RELEASE
ODIR := $(ODIR).release ODIR := $(ODIR).release
...@@ -46,7 +66,7 @@ include targets.mk # defines all and clean targets ...@@ -46,7 +66,7 @@ include targets.mk # defines all and clean targets
# Implicit C Compile Rule # Implicit C Compile Rule
$(ODIR)/%.o : %.c $(ODIR)/%.o : %.c
@echo Compiling $< @echo Compiling $<
@$(CC) $(CFLAGS) -c $< -o $@ @$(CC) $(CFLAGS) -c $< -o$@
# Create output directories # Create output directories
$(ODIR): $(ODIR):
...@@ -55,5 +75,5 @@ $(ODIR): ...@@ -55,5 +75,5 @@ $(ODIR):
# Executable Build Rule # Executable Build Rule
$(WRAPTEST): $(ODIR)/wraptest.o $(OBJS) $(WRAPTEST): $(ODIR)/wraptest.o $(OBJS)
@echo Linking $@ @echo Linking $@
@$(CC) $(LFLAGS) $^ -o $@ @$(CC) $(LFLAGS) $^ -o$@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment