-
-
Save ismaell/48fc527236888456d83a676d6c1ba9ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Makefile b/Makefile | |
index fdac9d365943..80a269357d53 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -9,18 +9,24 @@ ifndef OS | |
OS := lnx | |
endif | |
-ifeq ($(OS),lnx) | |
- CP := cp | |
- RM := rm -fr | |
-endif | |
+lnx-AR := ar | |
+lnx-CC := gcc | |
+lnx-CP := cp | |
+lnx-CXX := g++ | |
+lnx-RM := rm -fr | |
+ | |
+win-AR := $(PATH_INTERNAL_C)/c_compiler/bin/ar.exe | |
+win-CC := $(PATH_INTERNAL_C)/c_compiler/bin/gcc.exe | |
+win-CP := copy | |
+win-CXX := $(PATH_INTERNAL_C)/c_compiler/bin/c++.exe | |
+win-RM := del | |
+ | |
+CP := $($(OS)-CP) | |
+RM := $($(OS)-RM) | |
+AR := $($(OS)-AR) | |
+CC := $($(OS)-CC) | |
+CXX := $($(OS)-CXX) | |
-ifeq ($(OS),win) | |
- CP := copy | |
- AR := $(PATH_INTERNAL_C)/c_compiler/bin/ar.exe | |
- CC := $(PATH_INTERNAL_C)/c_compiler/bin/gcc.exe | |
- CXX := $(PATH_INTERNAL_C)/c_compiler/bin/c++.exe | |
- RM := del | |
-endif | |
ifdef BUILD_QB64 | |
EXE := qb64 | |
@@ -32,10 +38,6 @@ ifneq ($(filter clean,$(MAKECMDGOALS)),) | |
EXE := blah | |
endif | |
-ifndef EXE | |
-$(error Please provide executable name as 'EXE=executable') | |
-endif | |
-endif | |
all: $(EXE) | |
@@ -43,19 +45,14 @@ CLEAN_LIST := | |
CXXFLAGS := -w | |
-ifeq ($(OS),lnx) | |
- CXXLIBS := -lGL -lGLU -lX11 -lpthread -ldl -lrt | |
- CXXFLAGS += -DFREEGLUT_STATIC | |
-endif | |
- | |
-ifeq ($(OS),win) | |
- CXXLIBS := -static-libgcc -static-libstdc++ | |
- CXXFLAGS += -DGLEW_STATIC -DFREEGLUT_STATIC | |
-endif | |
+lnx-CXXLIBS := -lGL -lGLU -lX11 -lpthread -ldl -lrt | |
+lnx-CXXFLAGS += -DFREEGLUT_STATIC | |
+win-CXXLIBS := -static-libgcc -static-libstdc++ | |
+win-CXXFLAGS += -DGLEW_STATIC -DFREEGLUT_STATIC | |
+osx-CXXLIBS := -framework OpenGL -framework IOKit -framework GLUT -framework Cocoa | |
-ifeq ($(OS),osx) | |
- CXXLIBS := -framework OpenGL -framework IOKit -framework GLUT -framework Cocoa | |
-endif | |
+CXXLIBS := $($(OS)-CXXLIBS) | |
+CXXFLAGS := $($(OS)-CXXFLAGS) | |
QB_QBX_OBJ := $(PATH_INTERNAL_C)/qbx.o | |
@@ -65,6 +62,7 @@ EXE_OBJS += $(QB_QBX_OBJ) | |
CLEAN_LIST += $(QB_QBX_OBJ) | |
+# FIXME There should be only one Makefile by component | |
include $(PATH_INTERNAL_C)/libqb/os/lnx/build.mk | |
include $(PATH_INTERNAL_C)/parts/audio/conversion/os/lnx/build.mk | |
include $(PATH_INTERNAL_C)/parts/audio/decode/mp3_mini/os/lnx/build.mk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment