~pixelherodev/c3lib

ref: tmp c3lib/Makefile -rw-r--r-- 800 bytes
ddd78966Noam Preil tmp 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.PHONY:all

# TODO: set up configure script so I can use Werror during dev but disable it for everyone else
CFLAGS=-std=c17 -pedantic -Wall -O1 -march=native -g -D _POSIX_C_SOURCE=200809 -Werror

all:libc3.a

libc3.a: stb_ds.o util.o c3.o dump.o sema/scope.o sema/usage.o sema/serialize.o sema/type.o sema/expr.o tags.o codegen/c.o
	rm -f libc3.a
	$(AR) $(ARFLAGS) $@ $^

install: $(DESTDIR)/usr/lib/libc3.a
	@mkdir -p $(DESTDIR)/usr/include/c3/sema/
	@cp *.h $(DESTDIR)/usr/include/c3/ -v
	@cp sema/*.h $(DESTDIR)/usr/include/c3/sema/ -v

$(DESTDIR)/usr/lib/libc3.a: libc3.a
	@cp $< $@ -v

lib/z80e/cpu.o lib/z80e/log.o lib/z80e/registers.o: EXTRA_CFLAGS := -Wno-pedantic

%.o: %.c *.h sema/*.h make.conf
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@

clean:
	rm -f *.o codegen/*.o sema/*.o libc3.a