Socket options
[ps4-sdk.git] / Makefile
blobf92017baa39f097abea19acb4a73054e18319fe0
1 CC := gcc
2 AS := gcc
3 AR := ar
4 OBJCOPY := objcopy
5 ODIR := build
6 SDIR := source
7 IDIR := include
8 LDIR := lib
9 CFLAGS := -I$(IDIR) -O2 -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
10 SFLAGS := -nostartfiles -nostdlib -march=btver2 -mtune=btver2
11 CFILES := $(wildcard $(SDIR)/*.c)
12 SFILES := $(wildcard $(SDIR)/*.s)
13 OBJS := $(patsubst $(SDIR)/%.c, build/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, build/%.o, $(SFILES))
15 TARGET = lib$(shell basename $(CURDIR)).a
17 $(TARGET): $(ODIR) $(OBJS)
18 $(AR) rcs $@ $(OBJS)
20 $(ODIR)/%.o: $(SDIR)/%.c
21 $(CC) -c -o $@ $< $(CFLAGS)
23 $(ODIR)/%.o: $(SDIR)/%.s
24 $(AS) -c -o $@ $< $(SFLAGS)
26 $(ODIR):
27 @mkdir $@
29 .PHONY: clean
31 clean:
32 rm -f $(TARGET) $(ODIR)/*.o