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 @@
#########################################################################
# 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 #
# #
# usage: gmake [os=target_os] #
# usage: gmake [os=target_os] [bcc=1]
#
#########################################################################
# $Id$
# Macros
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 = /
OFILE = o
CFLAGS = -Wall
ifndef $(os)
os = $(shell uname)
$(warning OS not specified on command line, setting to '$(os)'.)
endif
ifdef bcc
ODIR := bcc.$(os)
else
ODIR := gcc.$(os)
endif
DELETE = rm -fv
......@@ -30,11 +41,20 @@ ifeq ($(os),FreeBSD) # FreeBSD
CFLAGS += -D_THREAD_SAFE
LFLAGS := -pthread
else # Linux / Other UNIX
ifdef bcc
LFLAGS := libpthread.a
else
LFLAGS := -lpthread
endif
endif
ifdef DEBUG
CFLAGS += -g -O0 -D_DEBUG
ifdef bcc
CFLAGS += -v -y
else
CFLAGS += -g
endif
CFLAGS += -D_DEBUG
ODIR := $(ODIR).debug
else # RELEASE
ODIR := $(ODIR).release
......@@ -46,7 +66,7 @@ include targets.mk # defines all and clean targets
# Implicit C Compile Rule
$(ODIR)/%.o : %.c
@echo Compiling $<
@$(CC) $(CFLAGS) -c $< -o $@
@$(CC) $(CFLAGS) -c $< -o$@
# Create output directories
$(ODIR):
......@@ -55,5 +75,5 @@ $(ODIR):
# Executable Build Rule
$(WRAPTEST): $(ODIR)/wraptest.o $(OBJS)
@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