Set up the new Unix build. Now to do the OS X build.
This commit is contained in:
parent
eb22f253b2
commit
acf3b3564e
|
@ -27,6 +27,8 @@ ifneq ($(NODEBUG),1)
|
||||||
LDFLAGS += -g
|
LDFLAGS += -g
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Build rules.
|
||||||
|
|
||||||
OFILES = \
|
OFILES = \
|
||||||
$(subst /,_,$(CFILES)) \
|
$(subst /,_,$(CFILES)) \
|
||||||
$(subst /,_,$(CXXFILES)) \
|
$(subst /,_,$(CXXFILES)) \
|
||||||
|
@ -37,10 +39,16 @@ OFILES := $(OFILES:%=$(OBJDIR)/%.o)
|
||||||
|
|
||||||
OUT = $(OUTDIR)/$(NAME)$(SUFFIX)
|
OUT = $(OUTDIR)/$(NAME)$(SUFFIX)
|
||||||
|
|
||||||
# TODO make the linker the C++ compiler in a C++ build if needed
|
# TODO allow using LD
|
||||||
|
# LD is defined by default so we need a way to override the default define without blocking a user define
|
||||||
|
ifeq ($(CXXFILES),)
|
||||||
|
reallinker = $(CC)
|
||||||
|
else
|
||||||
|
reallinker = $(CXX)
|
||||||
|
endif
|
||||||
|
|
||||||
$(OUT): $(OFILES) | $(OUTDIR)
|
$(OUT): $(OFILES) | $(OUTDIR)
|
||||||
@$(LD) -o $(OUT) $(OFILES) $(LDFLAGS)
|
@$(reallinker) -o $(OUT) $(OFILES) $(LDFLAGS)
|
||||||
@echo ====== Linked $(OUT)
|
@echo ====== Linked $(OUT)
|
||||||
|
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
|
@ -33,6 +33,14 @@ HFILES += \
|
||||||
|
|
||||||
# TODO split into a separate file or put in GNUmakefile.libui somehow?
|
# TODO split into a separate file or put in GNUmakefile.libui somehow?
|
||||||
|
|
||||||
|
# flags for GTK+
|
||||||
|
CFLAGS += \
|
||||||
|
`pkg-config --cflags gtk+-3.0`
|
||||||
|
CXXFLAGS += \
|
||||||
|
`pkg-config --cflags gtk+-3.0`
|
||||||
|
LDFLAGS += \
|
||||||
|
`pkg-config --libs gtk+-3.0` -lm
|
||||||
|
|
||||||
# flags for building a shared library
|
# flags for building a shared library
|
||||||
# OS X does support -shared but it has a preferred name for this so let's use that there instead; hence this is not gcc-global
|
# OS X does support -shared but it has a preferred name for this so let's use that there instead; hence this is not gcc-global
|
||||||
LDFLAGS += \
|
LDFLAGS += \
|
Loading…
Reference in New Issue