Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS (Darwin) support #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ src/locale/*.catalog
release/
/*.lha
/*.readme
.vscode/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FlexCat is a tool to create Amiga localization catalogs (*.catalog files) simila
## Features

* Runs on any computer (I hope)
* Fully portable (versions for AmigaOS3, AmigaOS4, MorphOS, AROS, Linux (i386) and Windows)
* Fully portable (versions for AmigaOS3, AmigaOS4, MorphOS, AROS, Linux (i386), macOS and Windows)
* Localized of course ;-) (AmigaOS versions only)
* Can produce catalog handling source code for any language (templates for Assembler, C, C++, E, Oberon and Modula-2 included)
* Written by the people who use it daily (so it should cover all your needs)
Expand Down
58 changes: 54 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ ifndef (OS)
ifeq ($(HOST), Windows)
OS = mingw32
else
ifeq ($(HOST), Darwin)
OS = darwin
else
ifeq ($(HOST), AROS)
# now we find out which CPU system aros will be used
ifeq ($(shell uname -m), powerpc)
Expand Down Expand Up @@ -103,6 +106,7 @@ ifndef (OS)
endif
endif
endif
endif
endif

#############################################
Expand Down Expand Up @@ -177,7 +181,7 @@ GCCVER = 4
WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare #-Wunreachable-code
OPTFLAGS = -O3 -fomit-frame-pointer -fno-strict-aliasing
DEBUG = -DDEBUG -fno-omit-frame-pointer #-O0
DEBUGSYM = -g -gstabs
DEBUGSYM = -g
CFLAGS = -I. -I./include $(CPU) $(WARN) $(OPTFLAGS) $(DEBUG) $(DEBUGSYM)
LDFLAGS = $(CPU) $(DEBUGSYM)
LDLIBS = -L$(LIB)
Expand All @@ -201,10 +205,13 @@ ifeq ($(OS), os4)
WARN += -Wdeclaration-after-statement -Wdisabled-optimization -Wshadow
REDEFINE = -DCoerceMethod=ICoerceMethod -DDoMethod=IDoMethod \
-DDoSuperMethod=IDoSuperMethod -DDoSuperMethodA=IDoSuperMethodA
DEBUGSYM += -gstabs
CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \
$(REDEFINE) -Wa,-mregnames -DAMIGA
LDFLAGS += -mcrt=$(CRT)
LDLIBS += -lauto -lunix
MAPFLAGS = -Wl,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S
CDUP = ../
CDTHIS = ./

Expand All @@ -227,9 +234,12 @@ ifeq ($(OS), os3)

# Compiler/Linker flags
CPU = -m68020-60 -msoft-float
DEBUGSYM += -gstabs
CFLAGS += -mcrt=clib2 -I./include/netinclude -DNO_INLINE_STDARG -D__amigaos3__ -DAMIGA
LDFLAGS += -mcrt=clib2
LDLIBS += -lamiga
MAPFLAGS = -Wl,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S
GCCVER = 2

SYSDEPOBJS = locale.o \
Expand All @@ -253,9 +263,12 @@ ifeq ($(OS), mos)

# Compiler/Linker flags
CPU = -mcpu=powerpc
DEBUGSYM += -gstabs
CFLAGS += -noixemul -I./include/netinclude -DAMIGA
LDFLAGS += -noixemul
LDLIBS += -lauto -lcodesets
MAPFLAGS = -Wl,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S
GCCVER = 2

SYSDEPOBJS = locale.o \
Expand All @@ -278,8 +291,11 @@ ifeq ($(OS), aros-i386)

# Compiler/Linker flags
OPTFLAGS = -O3 -fomit-frame-pointer
DEBUGSYM += -gstabs
CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG -D__BSD_VISIBLE=1 -DAMIGA
LDLIBS += -lamiga -larossupport -larosc
MAPFLAGS = -Wl,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S

SYSDEPOBJS = locale.o \
getft.o \
Expand All @@ -302,8 +318,11 @@ ifeq ($(OS), aros-ppc)

# Compiler/Linker flags
OPTFLAGS = -O3 -fomit-frame-pointer
DEBUGSYM += -gstabs
CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG -D__BSD_VISIBLE=1 -DAMIGA
LDLIBS += -lamiga -larossupport -larosc
MAPFLAGS = -Wl,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S

SYSDEPOBJS = locale.o \
getft.o \
Expand All @@ -326,8 +345,11 @@ ifeq ($(OS), aros-x86_64)

# Compiler/Linker flags
OPTFLAGS = -O3 -fomit-frame-pointer
DEBUGSYM += -gstabs
CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG -D__BSD_VISIBLE=1 -DAMIGA
LDLIBS += -lamiga -larossupport -larosc
MAPFLAGS = -Wl,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S

SYSDEPOBJS = locale.o \
getft.o \
Expand All @@ -350,8 +372,11 @@ ifeq ($(OS), aros-arm)

# Compiler/Linker flags
OPTFLAGS = -O3 -fomit-frame-pointer
DEBUGSYM += -gstabs
CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG -D__BSD_VISIBLE=1 -DAMIGA
LDLIBS += -lamiga -larossupport -larosc
MAPFLAGS = -Wl,-t,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S

SYSDEPOBJS = locale.o \
getft.o \
Expand All @@ -375,9 +400,12 @@ ifeq ($(OS), mingw32)
# Compiler/Linker flags
EXE = .exe
OPTFLAGS = -O3 -fomit-frame-pointer
DEBUGSYM += -gstabs
CFLAGS += -I./include/mingw32
LDFLAGS =
LDLIBS += -liconv
MAPFLAGS = -Wl,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S

SYSDEPOBJS = locale_other.o \
asprintf.o \
Expand All @@ -398,11 +426,33 @@ ifeq ($(OS), unix)

# Compiler/Linker flags
OPTFLAGS = -O3 -fomit-frame-pointer
DEBUGSYM += -gstabs
CFLAGS += -D_GNU_SOURCE
LDFLAGS =
MAPFLAGS = -Wl,--cref,-M,[email protected]
STRIPFLAGS = --preserve-dates -R.comment -R.sdata2 -S

SYSDEPOBJS = locale_other.o
else
ifeq ($(OS), darwin)
##############################
# macOS/Darwin (darwin)

ifneq ($(HOST), Darwin)
CC = clang
STRIP = strip
OBJDUMP = objdump
endif

# Compiler/Linker flags
OPTFLAGS = -O3 -fomit-frame-pointer
CFLAGS += -D_GNU_SOURCE
LDFLAGS = -liconv
MAPFLAGS = -Wl,-map,[email protected]
STRIPFLAGS = -x

SYSDEPOBJS = locale_other.o
endif
endif
endif
endif
Expand Down Expand Up @@ -502,9 +552,9 @@ endif

$(TARGET): $(CATFILES) $(addprefix $(OBJDIR)/,$(OBJS))
@echo " LD [email protected]"
@$(CC) $(LDFLAGS) -o [email protected] $(addprefix $(OBJDIR)/,$(OBJS)) $(LDLIBS) -Wl,--cref,-M,[email protected]
@$(CC) $(LDFLAGS) -o [email protected] $(addprefix $(OBJDIR)/,$(OBJS)) $(LDLIBS) $(MAPFLAGS)
@echo " LD $@"
@$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ [email protected]
@$(STRIP) $(STRIPFLAGS) -o $@ [email protected]
@$(CHMOD) $@

locale.c: locale/FlexCat.pot sd/NoAutoC_c.sd
Expand Down Expand Up @@ -559,7 +609,7 @@ cleanall: clean
doc:
$(MAKEINFO) ../doc/FlexCat_german.texinfo --amiga-39 --fill-column 76 --output ../doc/FlexCat_deutsch.guide
$(MAKEINFO) ../doc/FlexCat_english.texinfo --amiga-39 --fill-column 76 --output ../doc/FlexCat_english.guide
$(MAKEINFO) ../doc/FlexCat_spanish.texinfo --amiga-39 --fill-column 76 --output ../doc/FlexCat_espa�ol.guide
$(MAKEINFO) ../doc/FlexCat_spanish.texinfo --amiga-39 --fill-column 76 --output ../doc/FlexCat_espa�ol.guide
$(MAKEINFO) ../doc/FlexCat_swedish.texinfo --amiga-39 --fill-column 76 --output ../doc/FlexCat_svenska.guide

## DEPENDENCY INCLUDE #################
Expand Down