2020-02-27 10:22:51 +01:00

145 lines
3.1 KiB
Makefile

# GNU Make project makefile autogenerated by Premake
ifndef config
config=debug
endif
ifndef verbose
SILENT = @
endif
ifndef CC
CC = gcc
endif
ifndef CXX
CXX = g++
endif
ifndef AR
AR = ar
endif
ifeq ($(config),debug)
OBJDIR = obj/Debug
TARGETDIR = ../..
TARGET = $(TARGETDIR)/libgo2.so
DEFINES += -DDEBUG
INCLUDES += -I/usr/include/libdrm
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) $(ARCH) -g -fPIC -Wall
CXXFLAGS += $(CFLAGS)
LDFLAGS += -shared -lopenal -lEGL -levdev -lgbm -lpthread -ldrm -lm -lrga -lpng -lasound
LIBS +=
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
ifeq ($(config),release)
OBJDIR = obj/Release
TARGETDIR = ../..
TARGET = $(TARGETDIR)/libgo2.so
DEFINES += -DNDEBUG
INCLUDES += -I/usr/include/libdrm
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -fPIC -Wall
CXXFLAGS += $(CFLAGS)
LDFLAGS += -s -shared -lopenal -lEGL -levdev -lgbm -lpthread -ldrm -lm -lrga -lpng -lasound
LIBS +=
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
OBJECTS := \
$(OBJDIR)/audio.o \
$(OBJDIR)/input.o \
$(OBJDIR)/display.o \
$(OBJDIR)/queue.o \
RESOURCES := \
SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
SHELLTYPE := posix
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
SHELLTYPE := posix
endif
.PHONY: clean prebuild prelink
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
@:
$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
@echo Linking go2
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
$(TARGETDIR):
@echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(TARGETDIR)
else
$(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif
$(OBJDIR):
@echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(OBJDIR)
else
$(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif
clean:
@echo Cleaning go2
ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -f $(TARGET)
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif
prebuild:
$(PREBUILDCMDS)
prelink:
$(PRELINKCMDS)
ifneq (,$(PCH))
$(GCH): $(PCH)
@echo $(notdir $<)
-$(SILENT) cp $< $(OBJDIR)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
endif
$(OBJDIR)/audio.o: ../../src/audio.c
@echo $(notdir $<)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
$(OBJDIR)/input.o: ../../src/input.c
@echo $(notdir $<)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
$(OBJDIR)/display.o: ../../src/display.c
@echo $(notdir $<)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
$(OBJDIR)/queue.o: ../../src/queue.c
@echo $(notdir $<)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)