2020-03-17 04:31:30 +00:00
|
|
|
CC := gcc
|
|
|
|
CFLAGS := -Wall -Wextra -pedantic -std=c99 -g -O2
|
2020-04-26 22:14:41 +00:00
|
|
|
PROGRAMS := yaz0 makeromfs elf2rom mkldscript vtxdis
|
2021-01-02 04:24:29 +00:00
|
|
|
ZAPD := ZAPD/ZAPD.out
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
all: $(PROGRAMS)
|
2021-01-02 04:24:29 +00:00
|
|
|
cd ZAPD && $(MAKE)
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
clean:
|
2021-01-20 19:46:25 +00:00
|
|
|
$(RM) $(PROGRAMS) $(addsuffix .exe,$(PROGRAMS))
|
2021-01-02 04:24:29 +00:00
|
|
|
$(RM) ZAPD/ZAPD.out
|
2020-03-17 04:31:30 +00:00
|
|
|
# Need to clean the above line later...
|
|
|
|
|
|
|
|
mkldscript_SOURCES := mkldscript.c util.c
|
|
|
|
elf2rom_SOURCES := elf2rom.c elf32.c n64chksum.c util.c
|
|
|
|
yaz0_SOURCES := yaz0tool.c yaz0.c util.c
|
|
|
|
makeromfs_SOURCES := makeromfs.c n64chksum.c util.c
|
2020-04-26 22:14:41 +00:00
|
|
|
vtxdis_SOURCES := vtxdis.c
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2021-01-02 04:24:29 +00:00
|
|
|
#$(ZAPD):
|
|
|
|
# cd ZAPD && $(MAKE)
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
define COMPILE =
|
|
|
|
$(1): $($1_SOURCES)
|
|
|
|
$(CC) $(CFLAGS) $$^ -o $$@
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach p,$(PROGRAMS),$(eval $(call COMPILE,$(p))))
|