From b6c9b543165dd8909d6f7143084731067c2eec48 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 22 Oct 2017 12:09:00 +0200 Subject: [PATCH] Simplified desktop examples compilation --- examples/Makefile | 260 ++-------------------------------------------- 1 file changed, 8 insertions(+), 252 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 0dc044521..b0e6ff920 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -198,7 +198,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) else LDLIBS += -lopenal32dll endif - PHYSAC_LIBS = -static -lpthread + + # Required for physac examples + LDLIBS += -static -lpthread endif ifeq ($(PLATFORM_OS),LINUX) # Libraries for Debian GNU/Linux desktop compiling @@ -301,263 +303,17 @@ EXAMPLES = \ CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST)) # Default target entry -all: examples +all: $(EXAMPLES) # Generic compilation pattern +# NOTE: Examples must be ready for Android compilation! %: %.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# Compile all examples -examples: $(EXAMPLES) - -# compile [core] example - basic window -core/core_basic_window: core/core_basic_window.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - keyboard input -core/core_input_keys: core/core_input_keys.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - mouse input -core/core_input_mouse: core/core_input_mouse.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - mouse wheel -core/core_mouse_wheel: core/core_mouse_wheel.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - gamepad input -core/core_input_gamepad: core/core_input_gamepad.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - generate random values -core/core_random_values: core/core_random_values.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - color selection (collision detection) -core/core_color_select: core/core_color_select.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - drop files -core/core_drop_files: core/core_drop_files.c -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) +ifeq ($(PLATFORM),PLATFORM_ANDROID) + $(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$< else - @echo core_drop_files: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB or PLATFORM_RPI + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) endif -# compile [core] example - storage values -core/core_storage_values: core/core_storage_values.c -ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI)) - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -else - @echo core_storage_values: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB -endif - -# compile [core] example - gestures detection -core/core_gestures_detection: core/core_gestures_detection.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - 3d mode -core/core_3d_mode: core/core_3d_mode.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - 3d picking -core/core_3d_picking: core/core_3d_picking.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - 3d camera free -core/core_3d_camera_free: core/core_3d_camera_free.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - 3d camera first person -core/core_3d_camera_first_person: core/core_3d_camera_first_person.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - 2d camera -core/core_2d_camera: core/core_2d_camera.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - world screen -core/core_world_screen: core/core_world_screen.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [core] example - vr simulator -core/core_vr_simulator: core/core_vr_simulator.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shapes] example - raylib logo (with basic shapes) -shapes/shapes_logo_raylib: shapes/shapes_logo_raylib.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shapes] example - basic shapes usage (rectangle, circle, ...) -shapes/shapes_basic_shapes: shapes/shapes_basic_shapes.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shapes] example - raylib color palette -shapes/shapes_colors_palette: shapes/shapes_colors_palette.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shapes] example - raylib logo animation -shapes/shapes_logo_raylib_anim: shapes/shapes_logo_raylib_anim.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shapes] example - lines bezier -shapes/shapes_lines_bezier: shapes/shapes_lines_bezier.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - raylib logo texture loading -textures/textures_logo_raylib: textures/textures_logo_raylib.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - image loading and conversion to texture -textures/textures_image_loading: textures/textures_image_loading.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - texture rectangle drawing -textures/textures_rectangle: textures/textures_rectangle.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - texture source and destination rectangles -textures/textures_srcrec_dstrec: textures/textures_srcrec_dstrec.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - texture to image -textures/textures_to_image: textures/textures_to_image.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - texture raw data -textures/textures_raw_data: textures/textures_raw_data.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - texture particles blending -textures/textures_particles_blending: textures/textures_particles_blending.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - texture image processing -textures/textures_image_processing: textures/textures_image_processing.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [textures] example - texture image drawing -textures/textures_image_drawing: textures/textures_image_drawing.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [text] example - sprite fonts loading -text/text_sprite_fonts: text/text_sprite_fonts.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [text] example - bmfonts and ttf loading -text/text_bmfont_ttf: text/text_bmfont_ttf.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [text] example - raylib fonts -text/text_raylib_fonts: text/text_raylib_fonts.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [text] example - text formatting -text/text_format_text: text/text_format_text.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [text] example - text writing animation -text/text_writing_anim: text/text_writing_anim.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [text] example - text ttf loading -text/text_ttf_loading: text/text_ttf_loading.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [text] example - text bmfont unordered -text/text_bmfont_unordered: text/text_bmfont_unordered.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [text] example - text input box -text/text_input_box: text/text_input_box.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [models] example - basic geometric 3d shapes -models/models_geometric_shapes: models/models_geometric_shapes.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [models] example - box collisions -models/models_box_collisions: models/models_box_collisions.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [models] example - basic window -models/models_planes: models/models_planes.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [models] example - billboard usage -models/models_billboard: models/models_billboard.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [models] example - OBJ model loading -models/models_obj_loading: models/models_obj_loading.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [models] example - heightmap loading -models/models_heightmap: models/models_heightmap.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [models] example - cubesmap loading -models/models_cubicmap: models/models_cubicmap.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [models] example - model mesh picking -models/models_mesh_picking: models/models_mesh_picking.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shaders] example - model shader -shaders/shaders_model_shader: shaders/shaders_model_shader.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shaders] example - shapes texture shader -shaders/shaders_shapes_textures: shaders/shaders_shapes_textures.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shaders] example - custom uniform in shader -shaders/shaders_custom_uniform: shaders/shaders_custom_uniform.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [shaders] example - postprocessing shader -shaders/shaders_postprocessing: shaders/shaders_postprocessing.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [audio] example - sound loading and playing (WAV and OGG) -audio/audio_sound_loading: audio/audio_sound_loading.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [audio] example - music stream playing (OGG) -audio/audio_music_stream: audio/audio_music_stream.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [audio] example - module playing (XM) -audio/audio_module_playing: audio/audio_module_playing.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [audio] example - raw audio streaming -audio/audio_raw_stream: audio/audio_raw_stream.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) - -# compile [physac] example - physics demo -physac/physics_demo: physac/physics_demo.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM) - -# compile [physac] example - physics friction -physac/physics_friction: physac/physics_friction.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM) - -# compile [physac] example - physics movement -physac/physics_movement: physac/physics_movement.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM) - -# compile [physac] example - physics restitution -physac/physics_restitution: physac/physics_restitution.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM) - -# compile [physac] example - physics shatter -physac/physics_shatter: physac/physics_shatter.c - $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM) - # fix dylib install path name for each executable (MAC) fix_dylib: ifeq ($(PLATFORM_OS),OSX)