From 191e22c58f2d0570accf145e53174d379f01e543 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Sat, 6 Apr 2002 01:51:51 +0000 Subject: [PATCH] First hack at a GNU makefile for Unix. --- src/xpdev/GNUmakefile | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/xpdev/GNUmakefile diff --git a/src/xpdev/GNUmakefile b/src/xpdev/GNUmakefile new file mode 100644 index 0000000000..d7b0b96097 --- /dev/null +++ b/src/xpdev/GNUmakefile @@ -0,0 +1,65 @@ +# GNUmakefile + +######################################################################### +# Makefile for cross-platform development "wrappers" test # +# For use with GNU make and GNU C Compiler # +# @format.tab-size 4, @format.use-tabs true # +# # +# usage: gmake # +######################################################################### + +# $Id$ + +# Macros +DEBUG = 1 # Comment out for release (non-debug) version +CC = gcc +SLASH = / +OFILE = o + +LD = ld +LIBFILE = .a +EXEFILE = + +ifndef $(os) +os = $(shell uname) +$(warning OS not specified on command line, setting to '$(os)'.) +endif + +ODIR := gcc.$(os) + +DELETE = rm -fv + +ifeq ($(os),FreeBSD) # FreeBSD +CFLAGS += -D_THREAD_SAFE +# Uses pthread +LFLAGS := -pthread +else # Linux / Other UNIX +# Math and pthread libraries needed +LFLAGS := -lpthread +endif + +ifdef DEBUG +CFLAGS += -g -O0 -D_DEBUG +ODIR := $(ODIR).debug +else # RELEASE +ODIR := $(ODIR).release +endif + +include objects.mk # defines $(OBJS) + +all: $(ODIR) $(ODIR)/wraptest.exe + +# Implicit C Compile Rule +$(ODIR)/%.o : %.c + @echo Compiling $< + @$(CC) $(CFLAGS) -c $< -o $@ + +# Create output directories +$(ODIR): + mkdir $(ODIR) + +# Executable Build Rule +$(ODIR)/wraptest: $(ODIR)\wraptest.o $(OBJS) + @echo Linking $@ + @$(CC) $(LFLAGS) $^ -o $@ + -- GitLab