Changeset 5186


Ignore:
Timestamp:
Mar 5, 2010, 11:20:28 AM (5 years ago)
Author:
stepan
Message:

This patch fixes two things:

  • -m32 is already defined by xcompile if the compiler is a 64bit compiler so drop it from the Makefile.
  • allow "obj-.. += foo.o" for util/, too. Otherwise the source files in util/x86emu/ put their objects in util/ instead of $(obj)/util

Signed-off-by: Stefan Reinauer <stepan@…>
Acked-by: Stefan Reinauer <stepan@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r5171 r5186  
    120120ldscripts:=
    121121types:=obj initobj driver smmobj
    122 includemakefiles=$(foreach type,$(2), $(eval $(type)-y:=)) $(eval subdirs-y:=) $(eval -include $(1)) $(if $(strip $(3)),$(foreach type,$(2),$(eval $(type)s+=$$(patsubst src/%,$(obj)/%,$$(addprefix $(dir $(1)),$$($(type)-y)))))) $(eval subdirs+=$$(subst $(PWD)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))
     122includemakefiles=$(foreach type,$(2), $(eval $(type)-y:=)) $(eval subdirs-y:=) $(eval -include $(1)) $(if $(strip $(3)),$(foreach type,$(2),$(eval $(type)s+=$$(patsubst util/%,$(obj)/util/%,$$(patsubst src/%,$(obj)/%,$$(addprefix $(dir $(1)),$$($(type)-y))))))) $(eval subdirs+=$$(subst $(PWD)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))
    123123evaluate_subdirs=$(eval cursubdirs:=$(subdirs)) $(eval subdirs:=) $(foreach dir,$(cursubdirs),$(eval $(call includemakefiles,$(dir)/Makefile.inc,$(types),$(1)))) $(if $(subdirs),$(eval $(call evaluate_subdirs, $(1))))
    124124
     
    149149        iasl -p $$(basename $$@) -tc $$(basename $$@).asl
    150150        mv $$(basename $$@).hex $$(basename $$@).c
    151         $(CC) -m32 $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $$@))), -DAmlCode=AmlCode_$$(basename $$(notdir $$@))) -c -o $$@ $$(basename $$@).c
     151        $(CC) $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $$@))), -DAmlCode=AmlCode_$$(basename $$(notdir $$@))) -c -o $$@ $$(basename $$@).c
    152152endef
    153153
    154154define objs_c_template
     155$(obj)/$(1)%.o: $(1)%.c $(obj)/config.h
     156        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
     157        $(CC) $$(CFLAGS) -c -o $$@ $$<
     158
    155159$(obj)/$(1)%.o: src/$(1)%.c $(obj)/config.h
    156160        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
    157         $(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
     161        $(CC) $$(CFLAGS) -c -o $$@ $$<
    158162endef
    159163
    160164define objs_S_template
     165$(obj)/$(1)%.o: $(1)%.S $(obj)/config.h
     166        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
     167        $(CC) -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
     168
    161169$(obj)/$(1)%.o: src/$(1)%.S $(obj)/config.h
    162170        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
    163         $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
     171        $(CC) -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
    164172endef
    165173
     
    167175$(obj)/$(1)%.initobj.o: src/$(1)%.c $(obj)/config.h
    168176        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
    169         $(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
     177        $(CC) $$(CFLAGS) -c -o $$@ $$<
    170178endef
    171179
     
    173181$(obj)/$(1)%.initobj.o: src/$(1)%.S $(obj)/config.h
    174182        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
    175         $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
     183        $(CC) -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
    176184endef
    177185
     
    179187$(obj)/$(1)%.driver.o: src/$(1)%.c $(obj)/config.h
    180188        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
    181         $(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
     189        $(CC) $$(CFLAGS) -c -o $$@ $$<
    182190endef
    183191
     
    185193$(obj)/$(1)%.driver.o: src/$(1)%.S
    186194        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
    187         $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
     195        $(CC) -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
    188196endef
    189197
     
    191199$(obj)/$(1)%.smmobj.o: src/$(1)%.c
    192200        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
    193         $(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
     201        $(CC) $$(CFLAGS) -c -o $$@ $$<
    194202endef
    195203
     
    197205$(obj)/$(1)%.smmobj.o: src/$(1)%.S
    198206        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
    199         $(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
     207        $(CC) $$(CFLAGS) -c -o $$@ $$<
    200208endef
    201209
Note: See TracChangeset for help on using the changeset viewer.