forked from rebecca/BSX
1
0
Fork 0

Compare commits

..

1 Commits
build ... main

Author SHA1 Message Date
Rebecca Buckingham f4653891c7 Refactored CPU_run 2024-07-23 20:10:49 -04:00
1 changed files with 4 additions and 10 deletions

View File

@ -1,24 +1,18 @@
# Variables # Variables
CC = gcc CC = gcc
# Probably this won't work on a mac using xcode. CFLAGS = -Wall -Wextra -std=c11 -I/usr/local/include/SDL2
# See https://stackoverflow.com/questions/3071321/how-to-use-pkg-config-for-setting-include-paths-in-xcode LDFLAGS = -L/usr/local/lib -lSDL2
# for possible workarounds?
# != is a GNU make extension, so may also not work on *BSD
SDL_CFLAGS!=pkg-config --cflags sdl2
SDL_LFLAGS!=pkg-config --libs sdl2
CFLAGS = -Wall -Wextra -std=c11 $(SDL_CFLAGS)
LDFLAGS = $(SDL_LFLAGS) -lm
SRC_DIR = src SRC_DIR = src
SOURCES = $(wildcard $(SRC_DIR)/*.c) SOURCES = $(wildcard $(SRC_DIR)/*.c)
OBJECTS = $(SOURCES:$(SRC_DIR)/%.c=%.o) OBJECTS = $(SOURCES:$(SRC_DIR)/%.c=%.o)
TARGET = bsx TARGET = bsx
# Default target # Default target
all: $(TARGET) Makefile all: $(TARGET)
# Linking # Linking
$(TARGET): $(OBJECTS) $(TARGET): $(OBJECTS)
$(CC) -o $@ $^ $(LDFLAGS) $(CC) $(LDFLAGS) -o $@ $^
# Compiling # Compiling
%.o: $(SRC_DIR)/%.c %.o: $(SRC_DIR)/%.c